-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue.config.js
92 lines (81 loc) · 2.15 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
const path = require("path");
const moment = require("moment");
// const webpack = require('webpack');
process.env.VUE_APP_VERSION = require("./package.json").version;
process.env.VUE_APP_VER_TIME = moment().format("YYYY-MM-DD");
function resolve(dir) {
return path.join(__dirname, dir);
}
// const proxyOptions = {
// target: "http://127.0.0.1:7777"
// // pathRewrite: { "^/socket.io": "" }
// };
// vue.config.js
const vueConfig = {
outputDir: process.env.VUE_APP_PATH,
publicPath: `/${process.env.VUE_APP_PATH}`,
chainWebpack: config => {
config.resolve.alias.set("@$", resolve("src"));
const svgRule = config.module.rule("svg");
svgRule.uses.clear();
svgRule
.oneOf("inline")
.resourceQuery(/inline/)
.use("vue-svg-icon-loader")
.loader("vue-svg-icon-loader")
.end()
.end()
.oneOf("external")
.use("file-loader")
.loader("file-loader")
.options({
name: "assets/[name].[hash:8].[ext]"
});
// config.module
// .rule("imports-loader")
// .test(/\.(vue|(j|t)sx?)$/)
// .use("imports-loader")
// .loader("imports-loader?window.Quill=quill")
// .end()
// .include.add(path.resolve("./node_modules/quill-image-resize-module"));
},
configureWebpack: {
// module: {
// rules: [
// {
// test: /\.(vue|(j|t)sx?)$/,
// loader: "imports-loader?window.Quill=quill",
// include: path.resolve("./node_modules/quill-image-resize-module")
// }
// ]
// }
// plugins: [
// new webpack.ProvidePlugin({
// 'window.Quill': 'quill/dist/quill.js',
// 'Quill': 'quill/dist/quill.js'
// }),
// ]
},
css: {
loaderOptions: {
less: {
lessOptions: {
javascriptEnabled: true
}
}
}
},
devServer: {
// // development server port 8000
// port: 8888,
// proxy: {
// "^/socket.io": proxyOptions
// }
},
// disable source map in production
productionSourceMap: false,
lintOnSave: undefined,
// babel-loader no-ignore node_modules/*
transpileDependencies: []
};
module.exports = vueConfig;