build: fix compat build exports (again)

This commit is contained in:
Evan You 2021-09-07 12:38:19 -04:00
parent d534515836
commit 22a9b3711c

View File

@ -81,11 +81,6 @@ function createConfig(format, output, plugins = []) {
process.exit(1)
}
const isCompatBuild = !!packageOptions.compat
output.exports = isCompatBuild ? 'default' : 'named'
output.sourcemap = !!process.env.SOURCE_MAP
output.externalLiveBindings = false
const isProductionBuild =
process.env.__DEV__ === 'false' || /\.prod\.js$/.test(output.file)
const isBundlerESMBuild = /esm-bundler/.test(format)
@ -93,6 +88,11 @@ function createConfig(format, output, plugins = []) {
const isNodeBuild = format === 'cjs'
const isGlobalBuild = /global/.test(format)
const isCompatPackage = pkg.name === '@vue/compat'
const isCompatBuild = !!packageOptions.compat
output.exports = isCompatPackage ? 'auto' : 'named'
output.sourcemap = !!process.env.SOURCE_MAP
output.externalLiveBindings = false
if (isGlobalBuild) {
output.name = packageOptions.name