-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
49 lines (48 loc) · 1.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
const webpack = require('webpack')
const Dotenv = require('dotenv-webpack')
const GenerateJsonFile = require('generate-json-file-webpack-plugin')
const WebpackPreBuildPlugin = require('pre-build-webpack')
const fs = require('fs')
const moment = require('moment')
const path = './src/build.info.json'
const buildTime = moment().toISOString()
module.exports = {
lintOnSave: process.env.NODE_ENV !== 'production',
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
mapboxgl: 'mapbox-gl'
}),
new webpack.DefinePlugin({
VERSION: JSON.stringify(
moment(buildTime).format()
)
}),
new GenerateJsonFile({
filename: 'manifest.json',
value: {
buildTime
}
}),
new WebpackPreBuildPlugin(stats => {
if (!fs.existsSync(path)) {
fs.writeFileSync(
path,
JSON.stringify({
buildTime
})
)
}
}),
new Dotenv()
],
mode: 'development',
target: 'web',
output: {
filename: '[name].[hash].js'
},
devServer: {
disableHostCheck: true
}
}
}