-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.lang.config.js
47 lines (43 loc) · 1.21 KB
/
nuxt.lang.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const webpack = require("webpack");
const path = require("path");
module.exports = {
/*
** Build configuration
*/
build: {
//publicPath: process.env.NODE_ENV === "pre"? "https://precdn.viabtc.com/static/": "https://cdn.viabtc.com/static/",
filenames: {
manifest: "manifest.[hash:7].js",
css: "style.[chunkhash:7].css",
vendor: "vendor.[chunkhash:7].js",
app: "coinex.[chunkhash:7].js",
chunk: "[name].[chunkhash:7].js"
},
//vendor: ["babel-polyfill", "axios"],
extend(config, ctx) {
config.resolve = config.resolve || { modules: [] };
if(config.plugins.length > 1){
config.plugins = config.plugins.slice(0,1);
}
//多语言自动替换
config.module.rules.push({
test: /\.vue$/,
exclude: /(node_modules)|(\.nuxt)|(Privacy(.{2})\.vue)|(Service(.{2})\.vue)/,
loader: "i18n-cn-autotrans-loader",
enforce: "pre",
options: {
hashLength:8,
writeFile:true,
repeatFlag:"\\[R\\]",
root: "locales",
prefix: "",
originalLang:"zh_Hans_CN",
targetLangs: [],
cacheTime: 5000
}
});
}
},
plugins: [
]
};