-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
52 lines (52 loc) · 1.16 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
const { defineConfig } = require("@vue/cli-service");
const path = require("path");
const { DefinePlugin } = require("webpack");
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
mainFiles: ["index"],
extensions: [".ts", ".js", ".vue"],
},
plugins: [
new DefinePlugin({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
}),
],
module: {
rules: [
{
test: /\.scss$/,
use: ["sass-loader"],
},
{
test: /\.node$/,
use: "node-loader",
}
],
},
},
devServer: {
port: process.env.PORT || 9528,
},
chainWebpack: (config) => {
config.module
.rule("svg")
.exclude.add(path.resolve(__dirname, "src/icons"))
.end();
config.module
.rule("icons")
.test(/\.svg$/)
.include.add(path.resolve(__dirname, "src/icons"))
.end()
.use("svg-sprite-loader")
.loader("svg-sprite-loader")
.options({
symbolId: "icon-[name]",
})
.end();
},
});