Skip to content

Commit

Permalink
build: deprecation warnings rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Mar 1, 2021
1 parent 866f0d5 commit 245a6ee
Show file tree
Hide file tree
Showing 3 changed files with 704 additions and 1,070 deletions.
18 changes: 11 additions & 7 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,19 @@ function createReplacePlugin(
? // preserve to be handled by bundlers
`(process.env.NODE_ENV !== 'production')`
: // hard coded dev/prod builds
!isProduction,
JSON.stringify(!isProduction),
// 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)
__BROWSER__: isBrowserBuild,
__FEATURE_PROD_DEVTOOLS__: isBundlerESMBuild
? `__VUE_PROD_DEVTOOLS__`
: false,
: 'false',
// is targeting bundlers?
__BUNDLER__: isBundlerESMBuild,
__GLOBAL__: isGlobalBuild,
__BUNDLER__: JSON.stringify(isBundlerESMBuild),
__GLOBAL__: JSON.stringify(isGlobalBuild),
// is targeting Node (SSR)?
__NODE_JS__: isNodeBuild,
__NODE_JS__: JSON.stringify(isNodeBuild),
}
// allow inline overrides like
//__RUNTIME_COMPILE__=true yarn build
Expand All @@ -166,7 +166,11 @@ function createReplacePlugin(
replacements[key] = process.env[key]
}
})
return replace(replacements)
// TODO: fix replacement thing
return replace({
preventAssignment: true,
values: replacements,
})
}

function createProductionConfig(format) {
Expand Down
27 changes: 15 additions & 12 deletions size-checks/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ const config = {
input: path.resolve(__dirname, './webRouter.js'),
plugins: [
replace({
__DEV__: false,
// this is only used during tests
__TEST__: false,
// If the build is expected to run directly in the browser (global / esm builds)
__BROWSER__: true,
// is targeting bundlers?
__BUNDLER__: false,
__GLOBAL__: false,
// is targeting Node (SSR)?
__NODE_JS__: false,
__VUE_PROD_DEVTOOLS__: false,
'process.env.NODE_ENV': JSON.stringify('production'),
preventAssignment: true,
values: {
__DEV__: 'false',
// this is only used during tests
__TEST__: 'false',
// If the build is expected to run directly in the browser (global / esm builds)
__BROWSER__: 'true',
// is targeting bundlers?
__BUNDLER__: 'false',
__GLOBAL__: 'false',
// is targeting Node (SSR)?
__NODE_JS__: 'false',
__VUE_PROD_DEVTOOLS__: 'false',
'process.env.NODE_ENV': JSON.stringify('production'),
},
}),
ts({
check: false,
Expand Down
Loading

0 comments on commit 245a6ee

Please sign in to comment.