ente/next.config.js

20 lines
573 B
JavaScript
Raw Normal View History

const WorkerPlugin = require('worker-plugin');
2020-10-03 14:21:56 +00:00
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
2020-10-03 14:21:56 +00:00
module.exports = withBundleAnalyzer({
target: 'serverless',
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
if (!isServer) {
config.plugins.push(
new WorkerPlugin({
// use "self" as the global object when receiving hot updates.
globalObject: 'self',
})
)
}
return config
},
2020-10-03 14:21:56 +00:00
});