Skip to content

Commit 245a6ee

Browse files
committed
build: deprecation warnings rollup
1 parent 866f0d5 commit 245a6ee

File tree

3 files changed

+704
-1070
lines changed

3 files changed

+704
-1070
lines changed

rollup.config.js

+11-7
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,19 @@ function createReplacePlugin(
145145
? // preserve to be handled by bundlers
146146
`(process.env.NODE_ENV !== 'production')`
147147
: // hard coded dev/prod builds
148-
!isProduction,
148+
JSON.stringify(!isProduction),
149149
// this is only used during tests
150-
__TEST__: isBundlerESMBuild ? `(process.env.NODE_ENV === 'test')` : false,
150+
__TEST__: isBundlerESMBuild ? `(process.env.NODE_ENV === 'test')` : 'false',
151151
// If the build is expected to run directly in the browser (global / esm builds)
152152
__BROWSER__: isBrowserBuild,
153153
__FEATURE_PROD_DEVTOOLS__: isBundlerESMBuild
154154
? `__VUE_PROD_DEVTOOLS__`
155-
: false,
155+
: 'false',
156156
// is targeting bundlers?
157-
__BUNDLER__: isBundlerESMBuild,
158-
__GLOBAL__: isGlobalBuild,
157+
__BUNDLER__: JSON.stringify(isBundlerESMBuild),
158+
__GLOBAL__: JSON.stringify(isGlobalBuild),
159159
// is targeting Node (SSR)?
160-
__NODE_JS__: isNodeBuild,
160+
__NODE_JS__: JSON.stringify(isNodeBuild),
161161
}
162162
// allow inline overrides like
163163
//__RUNTIME_COMPILE__=true yarn build
@@ -166,7 +166,11 @@ function createReplacePlugin(
166166
replacements[key] = process.env[key]
167167
}
168168
})
169-
return replace(replacements)
169+
// TODO: fix replacement thing
170+
return replace({
171+
preventAssignment: true,
172+
values: replacements,
173+
})
170174
}
171175

172176
function createProductionConfig(format) {

size-checks/rollup.config.js

+15-12
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,21 @@ const config = {
1515
input: path.resolve(__dirname, './webRouter.js'),
1616
plugins: [
1717
replace({
18-
__DEV__: false,
19-
// this is only used during tests
20-
__TEST__: false,
21-
// If the build is expected to run directly in the browser (global / esm builds)
22-
__BROWSER__: true,
23-
// is targeting bundlers?
24-
__BUNDLER__: false,
25-
__GLOBAL__: false,
26-
// is targeting Node (SSR)?
27-
__NODE_JS__: false,
28-
__VUE_PROD_DEVTOOLS__: false,
29-
'process.env.NODE_ENV': JSON.stringify('production'),
18+
preventAssignment: true,
19+
values: {
20+
__DEV__: 'false',
21+
// this is only used during tests
22+
__TEST__: 'false',
23+
// If the build is expected to run directly in the browser (global / esm builds)
24+
__BROWSER__: 'true',
25+
// is targeting bundlers?
26+
__BUNDLER__: 'false',
27+
__GLOBAL__: 'false',
28+
// is targeting Node (SSR)?
29+
__NODE_JS__: 'false',
30+
__VUE_PROD_DEVTOOLS__: 'false',
31+
'process.env.NODE_ENV': JSON.stringify('production'),
32+
},
3033
}),
3134
ts({
3235
check: false,

0 commit comments

Comments
 (0)