@intlify/bundle-utils 6.0.0 → 6.0.1
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/index.cjs +4 -4
- package/lib/index.mjs +4 -4
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -146,7 +146,7 @@ function generateMessageFunction(msg, options, path) {
|
|
|
146
146
|
};
|
|
147
147
|
const { code, ast, map } = baseCompile(_msg, newOptions);
|
|
148
148
|
const occured = errors.length > 0;
|
|
149
|
-
const genCode = !occured ? env === "development" ? `(()=>{const fn=${code};fn.source=${JSON.stringify(msg)};return fn;})()` : `${code}` : _msg
|
|
149
|
+
const genCode = !occured ? env === "development" ? `(()=>{const fn=${code};fn.source=${JSON.stringify(msg)};return fn;})()` : `${code}` : `\`${_msg}\``;
|
|
150
150
|
return { code: genCode, ast, map, errors };
|
|
151
151
|
}
|
|
152
152
|
function mapLinesColumns(resMap, codeMaps, inSourceMap) {
|
|
@@ -319,7 +319,7 @@ function generateNode$2(generator, node, options, injector) {
|
|
|
319
319
|
const exportSyntax = bridge ? exportESM ? `export default` : `module.exports =` : `export default`;
|
|
320
320
|
generator.push(`${exportSyntax} function (Component) {`);
|
|
321
321
|
generator.indent();
|
|
322
|
-
const componentVariable = bridge ? `Component.options || Component` : useClassComponent ? `Component.__o || Component` : `Component`;
|
|
322
|
+
const componentVariable = bridge ? `Component.options || Component` : useClassComponent ? `Component.__o || Component.__vccOpts || Component` : `Component`;
|
|
323
323
|
generator.pushline(`const ${componentNamespace} = ${componentVariable}`);
|
|
324
324
|
generator.pushline(
|
|
325
325
|
`${componentNamespace}.${variableName} = ${componentNamespace}.${variableName} || []`
|
|
@@ -590,7 +590,7 @@ function generateNode$1(generator, node, options, injector) {
|
|
|
590
590
|
const exportSyntax = bridge ? exportESM ? `export default` : `module.exports =` : `export default`;
|
|
591
591
|
generator.push(`${exportSyntax} function (Component) {`);
|
|
592
592
|
generator.indent();
|
|
593
|
-
const componentVariable = bridge ? `Component.options || Component` : useClassComponent ? `Component.__o || Component` : `Component`;
|
|
593
|
+
const componentVariable = bridge ? `Component.options || Component` : useClassComponent ? `Component.__o || Component.__vccOpts || Component` : `Component`;
|
|
594
594
|
generator.pushline(`const ${componentNamespace} = ${componentVariable}`);
|
|
595
595
|
generator.pushline(
|
|
596
596
|
`${componentNamespace}.${variableName} = ${componentNamespace}.${variableName} || []`
|
|
@@ -903,7 +903,7 @@ function generateNode(generator, node, options, injector) {
|
|
|
903
903
|
const exportSyntax = bridge ? exportESM ? `export default` : `module.exports =` : `export default`;
|
|
904
904
|
generator.push(`${exportSyntax} function (Component) {`);
|
|
905
905
|
generator.indent();
|
|
906
|
-
const componentVariable = bridge ? `Component.options || Component` : useClassComponent ? `Component.__o || Component` : `Component`;
|
|
906
|
+
const componentVariable = bridge ? `Component.options || Component` : useClassComponent ? `Component.__o || Component.__vccOpts || Component` : `Component`;
|
|
907
907
|
generator.pushline(`const ${componentNamespace} = ${componentVariable}`);
|
|
908
908
|
generator.pushline(
|
|
909
909
|
`${componentNamespace}.${variableName} = ${componentNamespace}.${variableName} || []`
|
package/lib/index.mjs
CHANGED
|
@@ -144,7 +144,7 @@ function generateMessageFunction(msg, options, path) {
|
|
|
144
144
|
};
|
|
145
145
|
const { code, ast, map } = baseCompile(_msg, newOptions);
|
|
146
146
|
const occured = errors.length > 0;
|
|
147
|
-
const genCode = !occured ? env === "development" ? `(()=>{const fn=${code};fn.source=${JSON.stringify(msg)};return fn;})()` : `${code}` : _msg
|
|
147
|
+
const genCode = !occured ? env === "development" ? `(()=>{const fn=${code};fn.source=${JSON.stringify(msg)};return fn;})()` : `${code}` : `\`${_msg}\``;
|
|
148
148
|
return { code: genCode, ast, map, errors };
|
|
149
149
|
}
|
|
150
150
|
function mapLinesColumns(resMap, codeMaps, inSourceMap) {
|
|
@@ -317,7 +317,7 @@ function generateNode$2(generator, node, options, injector) {
|
|
|
317
317
|
const exportSyntax = bridge ? exportESM ? `export default` : `module.exports =` : `export default`;
|
|
318
318
|
generator.push(`${exportSyntax} function (Component) {`);
|
|
319
319
|
generator.indent();
|
|
320
|
-
const componentVariable = bridge ? `Component.options || Component` : useClassComponent ? `Component.__o || Component` : `Component`;
|
|
320
|
+
const componentVariable = bridge ? `Component.options || Component` : useClassComponent ? `Component.__o || Component.__vccOpts || Component` : `Component`;
|
|
321
321
|
generator.pushline(`const ${componentNamespace} = ${componentVariable}`);
|
|
322
322
|
generator.pushline(
|
|
323
323
|
`${componentNamespace}.${variableName} = ${componentNamespace}.${variableName} || []`
|
|
@@ -588,7 +588,7 @@ function generateNode$1(generator, node, options, injector) {
|
|
|
588
588
|
const exportSyntax = bridge ? exportESM ? `export default` : `module.exports =` : `export default`;
|
|
589
589
|
generator.push(`${exportSyntax} function (Component) {`);
|
|
590
590
|
generator.indent();
|
|
591
|
-
const componentVariable = bridge ? `Component.options || Component` : useClassComponent ? `Component.__o || Component` : `Component`;
|
|
591
|
+
const componentVariable = bridge ? `Component.options || Component` : useClassComponent ? `Component.__o || Component.__vccOpts || Component` : `Component`;
|
|
592
592
|
generator.pushline(`const ${componentNamespace} = ${componentVariable}`);
|
|
593
593
|
generator.pushline(
|
|
594
594
|
`${componentNamespace}.${variableName} = ${componentNamespace}.${variableName} || []`
|
|
@@ -901,7 +901,7 @@ function generateNode(generator, node, options, injector) {
|
|
|
901
901
|
const exportSyntax = bridge ? exportESM ? `export default` : `module.exports =` : `export default`;
|
|
902
902
|
generator.push(`${exportSyntax} function (Component) {`);
|
|
903
903
|
generator.indent();
|
|
904
|
-
const componentVariable = bridge ? `Component.options || Component` : useClassComponent ? `Component.__o || Component` : `Component`;
|
|
904
|
+
const componentVariable = bridge ? `Component.options || Component` : useClassComponent ? `Component.__o || Component.__vccOpts || Component` : `Component`;
|
|
905
905
|
generator.pushline(`const ${componentNamespace} = ${componentVariable}`);
|
|
906
906
|
generator.pushline(
|
|
907
907
|
`${componentNamespace}.${variableName} = ${componentNamespace}.${variableName} || []`
|