@intlify/bundle-utils 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/js.js +5 -1
- package/lib/json.js +5 -1
- package/lib/yaml.js +5 -1
- package/package.json +1 -1
package/lib/js.js
CHANGED
|
@@ -129,7 +129,7 @@ function generateNode(generator, node, options, injector) {
|
|
|
129
129
|
switch (node.type) {
|
|
130
130
|
case 'Program':
|
|
131
131
|
if (type === 'plain') {
|
|
132
|
-
generator.push(`
|
|
132
|
+
generator.push(`const resource = `);
|
|
133
133
|
}
|
|
134
134
|
else if (type === 'sfc') {
|
|
135
135
|
// for 'sfc'
|
|
@@ -311,6 +311,10 @@ function generateNode(generator, node, options, injector) {
|
|
|
311
311
|
generator.deindent();
|
|
312
312
|
generator.pushline(`}`);
|
|
313
313
|
}
|
|
314
|
+
else if (type === 'plain') {
|
|
315
|
+
generator.push(`\n`);
|
|
316
|
+
generator.push('export default resource');
|
|
317
|
+
}
|
|
314
318
|
break;
|
|
315
319
|
case 'ObjectExpression':
|
|
316
320
|
if (propsCountStack[propsCountStack.length - 1] === 0) {
|
package/lib/json.js
CHANGED
|
@@ -89,7 +89,7 @@ function generateNode(generator, node, options, injector) {
|
|
|
89
89
|
switch (node.type) {
|
|
90
90
|
case 'Program':
|
|
91
91
|
if (type === 'plain') {
|
|
92
|
-
generator.push(`
|
|
92
|
+
generator.push(`const resource = `);
|
|
93
93
|
}
|
|
94
94
|
else if (type === 'sfc') {
|
|
95
95
|
// for 'sfc'
|
|
@@ -224,6 +224,10 @@ function generateNode(generator, node, options, injector) {
|
|
|
224
224
|
generator.deindent();
|
|
225
225
|
generator.pushline(`}`);
|
|
226
226
|
}
|
|
227
|
+
else if (type === 'plain') {
|
|
228
|
+
generator.push(`\n`);
|
|
229
|
+
generator.push('export default resource');
|
|
230
|
+
}
|
|
227
231
|
break;
|
|
228
232
|
case 'JSONObjectExpression':
|
|
229
233
|
if (propsCountStack[propsCountStack.length - 1] === 0) {
|
package/lib/yaml.js
CHANGED
|
@@ -79,7 +79,7 @@ function generateNode(generator, node, options, injector) {
|
|
|
79
79
|
switch (node.type) {
|
|
80
80
|
case 'Program':
|
|
81
81
|
if (type === 'plain') {
|
|
82
|
-
generator.push(`
|
|
82
|
+
generator.push(`const resource = `);
|
|
83
83
|
}
|
|
84
84
|
else if (type === 'sfc') {
|
|
85
85
|
const variableName = type === 'sfc' ? (!isGlobal ? '__i18n' : '__i18nGlobal') : '';
|
|
@@ -215,6 +215,10 @@ function generateNode(generator, node, options, injector) {
|
|
|
215
215
|
generator.deindent();
|
|
216
216
|
generator.push(`}`);
|
|
217
217
|
}
|
|
218
|
+
else if (type === 'plain') {
|
|
219
|
+
generator.push(`\n`);
|
|
220
|
+
generator.push('export default resource');
|
|
221
|
+
}
|
|
218
222
|
break;
|
|
219
223
|
case 'YAMLMapping':
|
|
220
224
|
if (propsCountStack[propsCountStack.length - 1] === 0) {
|