forked from icebob/kantab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
74 lines (63 loc) · 1.86 KB
/
vue.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
const path = require("path");
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
module.exports = {
chainWebpack: config => {
//config.context(path.join(__dirname, "frontend"));
if (process.argv.indexOf("--report") !== -1) {
config.plugin("webpack-report").use(BundleAnalyzerPlugin, [{}]);
}
config.module.rule("js").use("babel-loader")
.tap(options => Object.assign(options || {}, {
configFile: "./frontend/babel.config.js"
}));
/*const copy = config.plugin("copy");
copy.tap(args => {
if (args.length > 0) {
args[0].from = path.resolve("./frontend/public");
console.log(args);
return args;
} else {
copy.use(require("copy-webpack-plugin"), [[{
from: path.resolve(__dirname, "./frontend/public"),
to: path.resolve(__dirname, "./public"),
ignore: []
//ignore: publicCopyIgnore
}]]);
}
});*/
/*
config
.plugin("copy")
.use(require("copy-webpack-plugin"), [[{
from: path.resolve("./frontend/public"),
to: path.resolve("./public"),
//ignore: publicCopyIgnore
}]]);
*/
//.tap(args => console.log(args));
},
configureWebpack: config => {
const folder = path.join(__dirname, "frontend");
//config.context = folder;
config.entry.app = [path.join(folder, "main.js")];
config.resolve.alias["@"] = folder;
/*
config.plugins.copy.args[0] = [{
from: path.resolve(__dirname, "./frontend/public"),
to: path.resolve(__dirname, "./public"),
//ignore: publicCopyIgnore
}];
*/
// DEBUG
//require("fs").writeFileSync("./webpack.generated.config.js", JSON.stringify(config, null, 4), "utf8");
},
// More info: https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/lib/options.js
baseUrl: undefined,
outputDir: "./static",
assetsDir: undefined,
productionSourceMap: false,
/*pwa: {
name: "KanTab"
},*/
lintOnSave: false
};