forked from ts-pro/vue-eternal-loading
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
46 lines (41 loc) · 1.2 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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const webpack = require('webpack');
const config = {
configureWebpack: (config) => {
config.plugins.some((plugin, index) => {
// Get rid of useless `demo.html`
// from here `./node_modules/@vue/cli-service/lib/commands/build/resolveLibConfig.js`
// Issue: https://github.com/vuejs/vue-cli/issues/3291
return (plugin.options || {}).filename === 'demo.html'
? config.plugins.splice(index, 1)
: false;
});
return {
output: {
library: '',
},
};
},
chainWebpack: (config) => {
if (process.env.NODE_ENV === 'production') {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const pkg = require('./package.json');
const banner = `
${pkg.name} v${pkg.version}
(c) ${new Date().getFullYear()} ${pkg.author}
${pkg.license} License
`;
config.plugin('webpack-banner').use(webpack.BannerPlugin, [banner]);
}
},
};
if (process.env.NODE_ENV === 'development') {
config.devServer = {
open: true,
port: 8822,
host: 'localhost',
https: true,
disableHostCheck: true,
};
}
module.exports = config;