vue-i18n-extract-plugin 1.0.68 → 1.0.70
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/extract.js +5 -1
- package/lib/import-i18n-transform.js +3 -1
- package/package.json +1 -1
package/lib/extract.js
CHANGED
|
@@ -501,7 +501,11 @@ function processVueFile(code, options) {
|
|
|
501
501
|
return {
|
|
502
502
|
changed: true,
|
|
503
503
|
code: code
|
|
504
|
-
.replace(
|
|
504
|
+
.replace(
|
|
505
|
+
scriptContent,
|
|
506
|
+
padEmptyLine(transformedScript.replaceAll("$", "┇┇┇"))
|
|
507
|
+
)
|
|
508
|
+
.replaceAll("┇┇┇", "$")
|
|
505
509
|
.replace(templateContent, padEmptyLine(transformedTemplate))
|
|
506
510
|
};
|
|
507
511
|
}
|
|
@@ -129,7 +129,9 @@ async function i18nImportTransform(code, path, importNames, importPath) {
|
|
|
129
129
|
if (transformNeeded) {
|
|
130
130
|
const { code: newScript } = generate(ast);
|
|
131
131
|
return isVueLike(path)
|
|
132
|
-
? code
|
|
132
|
+
? code
|
|
133
|
+
.replace(scriptContent, newScript.replaceAll("$", "┇┇┇"))
|
|
134
|
+
.replaceAll("┇┇┇", "$")
|
|
133
135
|
: newScript;
|
|
134
136
|
}
|
|
135
137
|
return code;
|