-
Notifications
You must be signed in to change notification settings - Fork 3
/
vue.config.js
52 lines (46 loc) · 1.36 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
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const plugins = [];
if (process.env.VUE_APP_ENABLE_BUNDLE_ANALYZER === 'true') {
plugins.push(new BundleAnalyzerPlugin())
}
// plugins.push(
// new WorkerPlugin({
// filename: "[name].[contenthash].js",
// chunkFilename: "[name].[contenthash].js",
// globalObject: "self",
// })
// );
module.exports = {
configureWebpack: {
// plugins: [new BundleAnalyzerPlugin()],
plugins,
optimization: {
splitChunks: {
chunks: "all",
},
},
},
css: {
loaderOptions: {
// pass options to sass-loader
// @/ is an alias to src/
// so this assumes you have a file named `src/variables.sass`
// Note: this option is named as "prependData" in sass-loader v8
scss: {
additionalData: `@import "~@/styles/setup/_variables.scss";`,
},
},
},
pwa: {
workboxPluginMode: "InjectManifest",
workboxOptions: {
// swSrc is required in InjectManifest mode.
swSrc: "./src/service-worker.js",
// the service worker will only cache chunks below 5MB
// please refer to the bundle size to make sure chunks do not cross this threshould
// or else it might cause PWA update issues
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
// ...other Workbox options...
},
},
};