@@ -52,16 +52,6 @@ const outputConfigs = {
52
52
file : `dist/${ name } .esm-browser.js` ,
53
53
format : `es`
54
54
} ,
55
- /*
56
- 'esm-bundler': {
57
- file: `dist/${name}.esm-bundler.mjs`,
58
- format: `es`
59
- },
60
- 'esm-browser': {
61
- file: `dist/${name}.esm-browser.mjs`,
62
- format: `es`
63
- },
64
- */
65
55
cjs : {
66
56
// file: `dist/${name}.cjs.js`,
67
57
file : `dist/${ name } .cjs` ,
@@ -76,20 +66,14 @@ const outputConfigs = {
76
66
file : `dist/${ name } .runtime.mjs` ,
77
67
format : `es`
78
68
} ,
79
- 'browser-runtime' : {
80
- file : `dist/${ name } .runtime.esm-browser.js` ,
81
- format : 'es'
82
- } ,
83
- /*
84
- 'esm-bundler-runtime': {
85
- file: `dist/${name}.runtime.esm-bundler.mjs`,
69
+ 'mjs-node-runtime' : {
70
+ file : `dist/${ name } .runtime.node.mjs` ,
86
71
format : `es`
87
72
} ,
88
- 'esm- browser-runtime': {
89
- file: `dist/${name}.runtime.esm-browser.mjs `,
73
+ 'browser-runtime' : {
74
+ file : `dist/${ name } .runtime.esm-browser.js ` ,
90
75
format : 'es'
91
76
} ,
92
- */
93
77
'global-runtime' : {
94
78
file : `dist/${ name } .runtime.global.js` ,
95
79
format : 'iife'
@@ -216,6 +200,7 @@ function createConfig(format, _output, plugins = []) {
216
200
} ) ,
217
201
tsPlugin ,
218
202
createReplacePlugin (
203
+ name ,
219
204
isProductionBuild ,
220
205
isBundlerESMBuild ,
221
206
isBrowserESMBuild ,
@@ -243,6 +228,7 @@ function createConfig(format, _output, plugins = []) {
243
228
await fs . writeFile ( resolve ( `dist/${ stub } ` ) , contents )
244
229
console . log ( `created stub ${ pc . bold ( `dist/${ stub } ` ) } ` )
245
230
231
+ /*
246
232
// add the node specific version
247
233
if (format === 'mjs' || format === 'mjs-runtime') {
248
234
// NOTE:
@@ -271,6 +257,7 @@ function createConfig(format, _output, plugins = []) {
271
257
console.log(`created stub ${pc.bold(outfile)}`)
272
258
}
273
259
}
260
+ */
274
261
}
275
262
}
276
263
] ,
@@ -287,6 +274,7 @@ function createConfig(format, _output, plugins = []) {
287
274
}
288
275
289
276
function createReplacePlugin (
277
+ name ,
290
278
isProduction ,
291
279
isBundlerESMBuild ,
292
280
isBrowserESMBuild ,
@@ -300,11 +288,14 @@ function createReplacePlugin(
300
288
const replacements = {
301
289
__COMMIT__ : `"${ process . env . COMMIT } "` ,
302
290
__VERSION__ : `'${ masterVersion } '` ,
303
- __DEV__ : isBundlerESMBuild
304
- ? // preserve to be handled by bundlers
305
- `(process.env.NODE_ENV !== 'production')`
306
- : // hard coded dev/prod builds
307
- ! isProduction ,
291
+ __DEV__ :
292
+ [ 'vue-i18n' , 'petite-vue-i18n' ] . includes ( name ) && isNodeBuild
293
+ ? 'false' // tree-shake devtools
294
+ : isBundlerESMBuild
295
+ ? // preserve to be handled by bundlers
296
+ `(process.env.NODE_ENV !== 'production')`
297
+ : // hard coded dev/prod builds
298
+ ! isProduction ,
308
299
// this is only used during Vue's internal tests
309
300
__TEST__ : `false` ,
310
301
// If the build is expected to run directly in the browser (global / esm builds)
@@ -327,9 +318,12 @@ function createReplacePlugin(
327
318
__FEATURE_LEGACY_API__ : isBundlerESMBuild
328
319
? `__VUE_I18N_LEGACY_API__`
329
320
: `true` ,
330
- __FEATURE_PROD_VUE_DEVTOOLS__ : isBundlerESMBuild
331
- ? `__VUE_PROD_DEVTOOLS__`
332
- : `false` ,
321
+ __FEATURE_PROD_VUE_DEVTOOLS__ :
322
+ [ 'vue-i18n' , 'petite-vue-i18n' ] . includes ( name ) && isNodeBuild
323
+ ? 'false' // tree-shake devtools
324
+ : isBundlerESMBuild
325
+ ? `__VUE_PROD_DEVTOOLS__`
326
+ : `false` ,
333
327
__FEATURE_PROD_INTLIFY_DEVTOOLS__ : isBundlerESMBuild
334
328
? `__INTLIFY_PROD_DEVTOOLS__`
335
329
: `false` ,
0 commit comments