-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
59 lines (52 loc) · 1.52 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
const path = require('path');
const {
Configuration,
StdoutConsoleLogger,
} = require('@microparts/configuration-js');
const packageJson = require('./package.json');
const isDevelopment = process.env.NODE_ENV === 'development';
const isProduction = process.env.NODE_ENV === 'production';
const configuration = new Configuration('./configuration');
configuration.logger = new StdoutConsoleLogger();
configuration.load();
module.exports = {
lintOnSave: false,
css: {
extract: isProduction,
sourceMap: isDevelopment,
},
configureWebpack: {
module: {
rules: [
{
test: /\.json$/,
type: 'javascript/auto',
include: [
path.resolve(__dirname, 'stabs'),
path.resolve(__dirname, 'src'),
],
exclude: /node_modules/,
loader: path.resolve('./json-loader.js'),
},
],
},
},
chainWebpack: (config) => {
config.output.pathinfo(isDevelopment);
config.optimization.removeAvailableModules(!isDevelopment);
config.devServer.disableHostCheck(true);
config.plugin('html').tap((options) => {
/* eslint no-shadow: 0 */
/* eslint no-param-reassign: 0 */
/* eslint no-underscore-dangle: 0 */
options[0].__config = configuration.asEscapedJson();
options[0].__stage = configuration.stage;
return options;
});
config.plugin('define')
.tap((definitions) => {
definitions[0].VERSION = JSON.stringify(packageJson.version);
return definitions;
});
},
};