Skip to content

Commit

Permalink
build: fix compat build exports (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Sep 7, 2021
1 parent d534515 commit 22a9b37
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,18 @@ 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)
const isBrowserESMBuild = /esm-browser/.test(format)
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
Expand Down

0 comments on commit 22a9b37

Please sign in to comment.