-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrazzle.config.js
33 lines (28 loc) · 962 Bytes
/
razzle.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
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const SWPrecacheWebpackPlugin = require("sw-precache-webpack-plugin");
const PUBLIC_PATH = "https://tox-rebrand.herokuapp.com/"
module.exports = {
modify: (config, { target, dev }, webpack) => {
// do something to config
config.plugins = [
...config.plugins,
// process.env.NODE_ENV !== 'producion' && new BundleAnalyzerPlugin(),
new SWPrecacheWebpackPlugin(
{
cacheId: 'tox-rebrand',
dontCacheBustUrlsMatching: /\.\w{8}\./,
filename: 'service-worker.js',
filepath: config.output.path + '/public/' + 'service-worker.js',
minify: true,
navigateFallback: PUBLIC_PATH,
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/],
}
)
];
config.resolve = {
...config.resolve,
extensions: ['.mjs', '.js', '.jsx']
};
return config;
}
};