@dword-design/base-config-nuxt 3.0.27 → 3.0.31
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/dist/modules/i18n/index.js +11 -8
- package/package.json +4 -5
|
@@ -35,7 +35,8 @@ const checkNuxtI18nHead = async () => {
|
|
|
35
35
|
var _ref, _ref2, _layoutFiles;
|
|
36
36
|
|
|
37
37
|
const layoutFiles = (_ref = (_ref2 = ['default.vue', ...(await (0, _globby.default)('*', {
|
|
38
|
-
cwd: 'layouts'
|
|
38
|
+
cwd: 'layouts',
|
|
39
|
+
ignore: '-*'
|
|
39
40
|
}))], await _ref2), (0, _uniq.default)(_ref));
|
|
40
41
|
|
|
41
42
|
const checkLayoutFile = async layoutFile => {
|
|
@@ -48,7 +49,9 @@ const checkNuxtI18nHead = async () => {
|
|
|
48
49
|
if ((_layout$script = layout.script) !== null && _layout$script !== void 0 && _layout$script.content) {
|
|
49
50
|
var _layout$script2;
|
|
50
51
|
|
|
51
|
-
const ast = await babel.parse((_layout$script2 = layout.script) === null || _layout$script2 === void 0 ? void 0 : _layout$script2.content
|
|
52
|
+
const ast = await babel.parse((_layout$script2 = layout.script) === null || _layout$script2 === void 0 ? void 0 : _layout$script2.content, {
|
|
53
|
+
filename: 'index.js'
|
|
54
|
+
});
|
|
52
55
|
let valid = false;
|
|
53
56
|
(0, _traverse.default)(ast, {
|
|
54
57
|
ExportDefaultDeclaration: path => {
|
|
@@ -85,7 +88,7 @@ async function _default() {
|
|
|
85
88
|
|
|
86
89
|
await checkNuxtI18nHead();
|
|
87
90
|
await this.addModule([(0, _depcheckPackageName.default)`@nuxtjs/i18n`, {
|
|
88
|
-
detectBrowserLanguage: {
|
|
91
|
+
detectBrowserLanguage: localeFiles.length === 1 ? false : {
|
|
89
92
|
fallbackLocale: 'en',
|
|
90
93
|
redirectOn: 'no prefix',
|
|
91
94
|
useCookie: false
|
|
@@ -101,11 +104,11 @@ async function _default() {
|
|
|
101
104
|
iso: code
|
|
102
105
|
};
|
|
103
106
|
})(_localeFiles)),
|
|
104
|
-
seo:
|
|
105
|
-
strategy: 'prefix',
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
},
|
|
107
|
+
seo: localeFiles.length > 1,
|
|
108
|
+
strategy: localeFiles.length === 1 ? 'no_prefix' : 'prefix',
|
|
109
|
+
...(localeFiles.length === 1 && {
|
|
110
|
+
defaultLocale: _path.default.basename(localeFiles[0], '.json')
|
|
111
|
+
}),
|
|
109
112
|
...(process.env.BASE_URL && {
|
|
110
113
|
baseUrl: process.env.BASE_URL
|
|
111
114
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/base-config-nuxt",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.31",
|
|
4
4
|
"repository": "dword-design/base-config-nuxt",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@dword-design/base": "^8.0.0",
|
|
57
|
-
"@dword-design/puppeteer": "^5.0.
|
|
58
|
-
"@dword-design/tester": "^2.0.
|
|
57
|
+
"@dword-design/puppeteer": "^5.0.5",
|
|
58
|
+
"@dword-design/tester": "^2.0.9",
|
|
59
59
|
"@dword-design/tester-plugin-env": "^2.0.8",
|
|
60
60
|
"@dword-design/tester-plugin-puppeteer": "^2.1.19",
|
|
61
|
-
"@dword-design/tester-plugin-tmp-dir": "^2.1.
|
|
61
|
+
"@dword-design/tester-plugin-tmp-dir": "^2.1.3",
|
|
62
62
|
"@nuxtjs/sitemap": "^2.4.0",
|
|
63
63
|
"axios": "^0.22.0",
|
|
64
64
|
"depcheck": "^1.4.2",
|
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
"postcss-hexrgba": "^2.0.0",
|
|
68
68
|
"stealthy-require-no-leak": "^1.0.3",
|
|
69
69
|
"tree-kill-promise": "^2.0.0",
|
|
70
|
-
"with-local-tmp-dir": "^4.0.0",
|
|
71
70
|
"xml-formatter": "^2.1.2"
|
|
72
71
|
},
|
|
73
72
|
"engines": {
|