@@ -32,11 +32,13 @@ const banner = `/*!
3232// ensure TS checks only once for each build
3333let hasTSChecked = false
3434
35- const stubs = {
36- [ `dist/${ name } .cjs` ] : `${ name } .cjs.js` ,
37- [ `dist/${ name } .mjs` ] : `${ name } .esm-bundler.js` ,
38- [ `dist/${ name } .runtime.mjs` ] : `${ name } .runtime.esm-bundler.js` ,
39- [ `dist/${ name } .prod.cjs` ] : `${ name } .cjs.prod.js`
35+ function resolveStubs ( name , ns = '' ) {
36+ return {
37+ [ `dist/${ ns } ${ name } .cjs` ] : `${ ns } ${ name } .cjs.js` ,
38+ [ `dist/${ ns } ${ name } .mjs` ] : `${ ns } ${ name } .esm-bundler.js` ,
39+ [ `dist/${ ns } ${ name } .runtime.mjs` ] : `${ ns } ${ name } .runtime.esm-bundler.js` ,
40+ [ `dist/${ ns } ${ name } .prod.cjs` ] : `${ ns } ${ name } .cjs.prod.js`
41+ }
4042}
4143
4244function resolveOutputConfigs ( name , ns = '' ) {
@@ -102,6 +104,9 @@ if (name === 'vue-i18n-core') {
102104 ]
103105}
104106
107+ let stubs = resolveStubs ( name )
108+ stubs = Object . assign ( { } , stubs , resolveStubs ( name , 'petite-' ) )
109+
105110if ( process . env . NODE_ENV === 'production' ) {
106111 packageFormats . forEach ( format => {
107112 if ( packageOptions . prod === false ) {
@@ -153,12 +158,9 @@ function createConfig(format, _output, plugins = []) {
153158 process . env . __DEV__ === 'false' || / \. p r o d \. [ c m ] ? j s $ / . test ( output . file )
154159 const isBundlerESMBuild = / m j s / . test ( format )
155160 const isBrowserESMBuild = / b r o w s e r / . test ( format )
156- // const isNodeBuild = format === 'cjs' || format === 'cjs-lite'
157- const isNodeBuild =
158- output . file . includes ( '.node.' ) || format === 'cjs' || format === 'cjs-lite'
161+ const isNodeBuild = output . file . includes ( '.node.' ) || format === 'cjs'
159162 const isGlobalBuild = / g l o b a l / . test ( format )
160163 const isRuntimeOnlyBuild = / r u n t i m e / . test ( format )
161- // const isLite = /petite-vue-i18n/.test(name)
162164 const isLite = / p e t i t e - v u e - i 1 8 n / . test ( output . file )
163165
164166 if ( isGlobalBuild ) {
0 commit comments