@intlify/unplugin-vue-i18n 0.6.0 → 0.6.2
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/CHANGELOG.md +18 -0
- package/lib/index.cjs +8 -6
- package/lib/index.mjs +9 -7
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
|
|
2
|
+
## @intlify/unplugin-vue-i18n@0.6.2 (2022-09-27)
|
|
3
|
+
|
|
4
|
+
#### :bug: Bug Fixes
|
|
5
|
+
* [#187](https://github.com/intlify/bundle-tools/pull/187) fix(unplugin-vue-i18n): cannot set vue-i18n-bridge dist path ([@kazupon](https://github.com/kazupon))
|
|
6
|
+
|
|
7
|
+
#### Committers: 1
|
|
8
|
+
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## @intlify/unplugin-vue-i18n@0.6.1 (2022-09-26)
|
|
12
|
+
|
|
13
|
+
#### :zap: Improvement Features
|
|
14
|
+
* [#184](https://github.com/intlify/bundle-tools/pull/184) fix(unplugin-vue-i18n): port vue-i18n-bridge module detecting from vite-plugin-vue-i18n ([@kazupon](https://github.com/kazupon))
|
|
15
|
+
|
|
16
|
+
#### Committers: 1
|
|
17
|
+
- kazuya kawaguchi ([@kazupon](https://github.com/kazupon))
|
|
18
|
+
|
|
19
|
+
|
|
2
20
|
## @intlify/unplugin-vue-i18n@0.6.0 (2022-09-19)
|
|
3
21
|
|
|
4
22
|
#### :bug: Bug Fixes
|
package/lib/index.cjs
CHANGED
|
@@ -102,6 +102,7 @@ const INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID = "@intlify/vite-plugin-vue-i18n/messag
|
|
|
102
102
|
const VIRTUAL_PREFIX = "\0";
|
|
103
103
|
const debug = createDebug__default("unplugin-vue-i18n");
|
|
104
104
|
const installedPkg = bundleUtils.checkInstallPackage("@intlify/unplugin-vue-i18n", debug);
|
|
105
|
+
const installedVueI18nBridge = bundleUtils.checkVueI18nBridgeInstallPackage(debug);
|
|
105
106
|
const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
106
107
|
debug("plugin options:", options, meta.framework);
|
|
107
108
|
if (!["vite", "webpack"].includes(meta.framework)) {
|
|
@@ -133,7 +134,7 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
133
134
|
warn(`'useVueI18nImportName' option is experimental`);
|
|
134
135
|
}
|
|
135
136
|
debug("useVueI18nImportName", useVueI18nImportName);
|
|
136
|
-
const getAliasName = () => installedPkg === "petite-vue-i18n" && shared.isBoolean(useVueI18nImportName) && useVueI18nImportName ? "vue-i18n" : `${installedPkg}`;
|
|
137
|
+
const getAliasName = () => installedVueI18nBridge && installedPkg === "vue-i18n" ? "vue-i18n-bridge" : installedPkg === "petite-vue-i18n" && shared.isBoolean(useVueI18nImportName) && useVueI18nImportName ? "vue-i18n" : `${installedPkg}`;
|
|
137
138
|
const esm = shared.isBoolean(options.esm) ? options.esm : true;
|
|
138
139
|
debug("esm", esm);
|
|
139
140
|
let isProduction = false;
|
|
@@ -145,17 +146,18 @@ const unplugin = unplugin$1.createUnplugin((options = {}, meta) => {
|
|
|
145
146
|
config(config, { command }) {
|
|
146
147
|
normalizeConfigResolveAlias(config.resolve, meta.framework);
|
|
147
148
|
if (command === "build" && runtimeOnly) {
|
|
149
|
+
const aliasName = getAliasName();
|
|
150
|
+
debug(`alias name: ${aliasName}`);
|
|
148
151
|
if (shared.isArray(config.resolve.alias)) {
|
|
149
152
|
config.resolve.alias.push({
|
|
150
|
-
find:
|
|
151
|
-
replacement: `${
|
|
153
|
+
find: aliasName,
|
|
154
|
+
replacement: `${aliasName}/dist/${aliasName}.runtime.esm-bundler.js`
|
|
152
155
|
});
|
|
153
156
|
} else if (shared.isObject(config.resolve.alias)) {
|
|
154
|
-
config.resolve.alias[
|
|
157
|
+
config.resolve.alias[aliasName] = `${aliasName}/dist/${aliasName}.runtime.esm-bundler.js`;
|
|
155
158
|
}
|
|
156
|
-
debug(`alias name: ${getAliasName()}`);
|
|
157
159
|
debug(
|
|
158
|
-
`set ${
|
|
160
|
+
`set ${aliasName} runtime only: ${aliasName}/dist/${aliasName}.runtime.esm-bundler.js`
|
|
159
161
|
);
|
|
160
162
|
} else if (command === "serve" && installedPkg === "petite-vue-i18n" && useVueI18nImportName) {
|
|
161
163
|
normalizeConfigResolveAlias(config.resolve, meta.framework);
|
package/lib/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import createDebug from 'debug';
|
|
|
4
4
|
import fg from 'fast-glob';
|
|
5
5
|
import { isString, isArray, isBoolean, isObject, isNumber, isEmptyObject, assign, generateCodeFrame } from '@intlify/shared';
|
|
6
6
|
import { createFilter } from '@rollup/pluginutils';
|
|
7
|
-
import { checkInstallPackage, generateJSON, generateYAML } from '@intlify/bundle-utils';
|
|
7
|
+
import { checkInstallPackage, checkVueI18nBridgeInstallPackage, generateJSON, generateYAML } from '@intlify/bundle-utils';
|
|
8
8
|
import { parse as parse$1 } from '@vue/compiler-sfc';
|
|
9
9
|
import JSON5 from 'json5';
|
|
10
10
|
import yaml from 'js-yaml';
|
|
@@ -90,6 +90,7 @@ const INTLIFY_BUNDLE_IMPORT_DEPRECTED_ID = "@intlify/vite-plugin-vue-i18n/messag
|
|
|
90
90
|
const VIRTUAL_PREFIX = "\0";
|
|
91
91
|
const debug = createDebug("unplugin-vue-i18n");
|
|
92
92
|
const installedPkg = checkInstallPackage("@intlify/unplugin-vue-i18n", debug);
|
|
93
|
+
const installedVueI18nBridge = checkVueI18nBridgeInstallPackage(debug);
|
|
93
94
|
const unplugin = createUnplugin((options = {}, meta) => {
|
|
94
95
|
debug("plugin options:", options, meta.framework);
|
|
95
96
|
if (!["vite", "webpack"].includes(meta.framework)) {
|
|
@@ -121,7 +122,7 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
121
122
|
warn(`'useVueI18nImportName' option is experimental`);
|
|
122
123
|
}
|
|
123
124
|
debug("useVueI18nImportName", useVueI18nImportName);
|
|
124
|
-
const getAliasName = () => installedPkg === "petite-vue-i18n" && isBoolean(useVueI18nImportName) && useVueI18nImportName ? "vue-i18n" : `${installedPkg}`;
|
|
125
|
+
const getAliasName = () => installedVueI18nBridge && installedPkg === "vue-i18n" ? "vue-i18n-bridge" : installedPkg === "petite-vue-i18n" && isBoolean(useVueI18nImportName) && useVueI18nImportName ? "vue-i18n" : `${installedPkg}`;
|
|
125
126
|
const esm = isBoolean(options.esm) ? options.esm : true;
|
|
126
127
|
debug("esm", esm);
|
|
127
128
|
let isProduction = false;
|
|
@@ -133,17 +134,18 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
133
134
|
config(config, { command }) {
|
|
134
135
|
normalizeConfigResolveAlias(config.resolve, meta.framework);
|
|
135
136
|
if (command === "build" && runtimeOnly) {
|
|
137
|
+
const aliasName = getAliasName();
|
|
138
|
+
debug(`alias name: ${aliasName}`);
|
|
136
139
|
if (isArray(config.resolve.alias)) {
|
|
137
140
|
config.resolve.alias.push({
|
|
138
|
-
find:
|
|
139
|
-
replacement: `${
|
|
141
|
+
find: aliasName,
|
|
142
|
+
replacement: `${aliasName}/dist/${aliasName}.runtime.esm-bundler.js`
|
|
140
143
|
});
|
|
141
144
|
} else if (isObject(config.resolve.alias)) {
|
|
142
|
-
config.resolve.alias[
|
|
145
|
+
config.resolve.alias[aliasName] = `${aliasName}/dist/${aliasName}.runtime.esm-bundler.js`;
|
|
143
146
|
}
|
|
144
|
-
debug(`alias name: ${getAliasName()}`);
|
|
145
147
|
debug(
|
|
146
|
-
`set ${
|
|
148
|
+
`set ${aliasName} runtime only: ${aliasName}/dist/${aliasName}.runtime.esm-bundler.js`
|
|
147
149
|
);
|
|
148
150
|
} else if (command === "serve" && installedPkg === "petite-vue-i18n" && useVueI18nImportName) {
|
|
149
151
|
normalizeConfigResolveAlias(config.resolve, meta.framework);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlify/unplugin-vue-i18n",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "unplugin for Vue I18n",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"petite-vue-i18n": "*",
|
|
14
|
-
"vue-i18n": "*"
|
|
14
|
+
"vue-i18n": "*",
|
|
15
|
+
"vue-i18n-bridge": "*"
|
|
15
16
|
},
|
|
16
17
|
"peerDependenciesMeta": {
|
|
17
18
|
"petite-vue-i18n": {
|
|
@@ -19,10 +20,13 @@
|
|
|
19
20
|
},
|
|
20
21
|
"vue-i18n": {
|
|
21
22
|
"optional": true
|
|
23
|
+
},
|
|
24
|
+
"vue-i18n-bridge": {
|
|
25
|
+
"optional": true
|
|
22
26
|
}
|
|
23
27
|
},
|
|
24
28
|
"dependencies": {
|
|
25
|
-
"@intlify/bundle-utils": "^3.1
|
|
29
|
+
"@intlify/bundle-utils": "^3.2.1",
|
|
26
30
|
"@intlify/shared": "next",
|
|
27
31
|
"@rollup/pluginutils": "^4.2.0",
|
|
28
32
|
"@vue/compiler-sfc": "^3.2.23",
|