forked from retejs/rete.js.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
64 lines (62 loc) · 1.95 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
60
61
62
63
64
const path = require('path');
const WorkboxPlugin = require('workbox-webpack-plugin');
const WebpackPwaManifest = require('webpack-pwa-manifest');
const WebpackCdnPlugin = require('webpack-cdn-plugin');
const production = process.env.NODE_ENV === 'production';
module.exports = {
chainWebpack: config => {
!production && config.module
.rule('js-source-maps')
.test(/\.js$/)
.enforce('pre')
.use('source-map-loader')
.loader('source-map-loader')
.end()
},
configureWebpack: {
devtool: !production ? "source-map" : false,
plugins: [
...(production ? [new WorkboxPlugin.GenerateSW({
clientsClaim: true,
skipWaiting: true
})] : []),
new WebpackPwaManifest({
name: 'Rete.js documentation',
short_name: 'Rete.js',
background_color: '#ffffff',
icons: [
{
src: path.resolve('src/assets/icon.png'),
sizes: [96, 128, 192, 256, 384, 512]
}
]
}),
new WebpackCdnPlugin({
modules: [
{
name: 'vue',
var: 'Vue',
path: 'dist/vue.runtime.min.js'
},
{
name: 'vue-router',
var: 'VueRouter',
path: 'dist/vue-router.min.js'
},
{
name: 'iview',
var: 'iview',
path: 'dist/iview.min.js'
}
],
publicPath: '/node_modules'
})
],
module: {
rules: [{
resourceQuery: /blockType=code/,
loader: require.resolve('./loaders/code.js')
}]
}
}
}