forked from MorgunovE/test-1-list
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
57 lines (55 loc) · 1.58 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
const { join } = require('path');
/**
* Exports vue-cli configuration.
* @see https://cli.vuejs.org/config/
* @type {import("@vue/cli-service").ProjectOptions}
*/
module.exports = {
// disabled next line to have this build on netlify
// publicPath: process.env.NODE_ENV === 'production' ? '/list/' : '/',
publicPath: '/',
devServer: {
overlay: {
errors: true,
},
},
css: {
requireModuleExtension: false,
loaderOptions: {
css: {
modules: {
localIdentName:
process.env.NODE_ENV !== 'production'
? '[name]__[local]'
: '[hash:base64]',
},
},
},
},
chainWebpack(config) {
// Resolve from `src` directory
config.resolve.modules.prepend(join(process.cwd(), 'src'));
// Use `baseUrl` and `paths` from tsconfig.json
config.resolve.alias
.delete('@')
.end()
.plugin('tsconfig-paths')
.use(require('tsconfig-paths-webpack-plugin'));
// Drop console messages from production build
config.optimization.minimizer('terser').tap((args) => {
args[0].terserOptions.compress.drop_console = true;
return args;
});
// Limit inlined images to 1KB
config.module
.rule('images')
.use('url-loader')
.loader('url-loader')
.tap((options) => Object.assign(options, { limit: 1024 }));
// Support svg manipulation from css via https://github.com/JetBrains/svg-mixer/tree/master/packages/svg-transform-loader
config.module
.rule('svg')
.use('svg-transform-loader')
.loader('svg-transform-loader');
},
};