Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
allChunks: true,
}),
// Note that ServiceWorker plugin doesn't work with webpack dev server,
// So we only run it in production mode.
serviceWorker && new ServiceWorkerPreCachePlugin({
cacheId: 'GW2Armory',
filename: 'service-worker.js',
minify: production,
dontCacheBustUrlsMatching: /\.\w{8}\./,
navigateFallback: 'index.html',
// Ignore any source map files and the asset manifest.
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/, /gw2aEmbeds\.js$/],
}),
production && process.env.ROLLBAR_POST && new RollbarSourceMapPlugin({
accessToken: process.env.ROLLBAR_POST,
version: pkg.version,
// Rollbar can't have a trailing slash. Ends up creating
// URLS like: //gw2armory.com//3-chunk.9a82d951.js
publicPath: publicPath.slice(0, publicPath.length - 1),
}),
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales.
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
// You can remove this if you don't use Moment.js:
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
// See: https://medium.com/webpack/predictable-long-term-caching-with-webpack-d3eee1d3fa31
// >> Start longterm caching strategy.