This commit is contained in:
Georges KABBOUCHI
2020-09-19 17:57:27 +03:00
parent a2a6c74c16
commit 2b5422395b
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -66,6 +66,7 @@ function createConfig(format, output, plugins = []) {
output.banner = banner output.banner = banner
output.externalLiveBindings = false output.externalLiveBindings = false
output.globals = { vue: 'Vue' } output.globals = { vue: 'Vue' }
output.exports = 'named'
const isProductionBuild = /\.prod\.js$/.test(output.file) const isProductionBuild = /\.prod\.js$/.test(output.file)
const isGlobalBuild = format === 'global' const isGlobalBuild = format === 'global'
@@ -139,9 +140,9 @@ function createReplacePlugin(
__VERSION__: `"${pkg.version}"`, __VERSION__: `"${pkg.version}"`,
__DEV__: isBundlerESMBuild __DEV__: isBundlerESMBuild
? // preserve to be handled by bundlers ? // preserve to be handled by bundlers
`(process.env.NODE_ENV !== 'production')` `(process.env.NODE_ENV !== 'production')`
: // hard coded dev/prod builds : // hard coded dev/prod builds
!isProduction, !isProduction,
// this is only used during tests // this is only used during tests
__TEST__: isBundlerESMBuild ? `(process.env.NODE_ENV === 'test')` : false, __TEST__: isBundlerESMBuild ? `(process.env.NODE_ENV === 'test')` : false,
// If the build is expected to run directly in the browser (global / esm builds) // If the build is expected to run directly in the browser (global / esm builds)
+1 -1
View File
@@ -7,7 +7,7 @@
"sourceMap": false, "sourceMap": false,
"noEmit": true, "noEmit": true,
"target": "esnext", "target": "es2019",
"module": "esnext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "node",
"allowJs": false, "allowJs": false,