rsnext/test/integration/worker-loader/next.config.js
Ramiro Silveyra d'Avila d72b2d6e36
fix: webpack 5 and worker-loader support (#21050)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2021-01-14 01:48:49 -05:00

18 lines
366 B
JavaScript

module.exports = {
webpack: (config, { isServer }) => {
config.module.rules.unshift({
test: /\.worker\.(js|ts|tsx)$/,
loader: 'worker-loader',
options: {
filename: 'static/[hash].worker.js',
publicPath: '/_next/',
},
})
if (!isServer) {
config.output.globalObject = 'self'
}
return config
},
}