Unverified Commit d6c70508 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Remove module.exports from client bundles (#5093)

Removes `module.exports` so that `module` is no longer required

Ref: https://github.com/zeit/next.js/pull/4943#discussion_r213232263

This saves 15 bytes from every client bundle + 9 bytes from the initial HTML.
parent 885eee80
...@@ -185,7 +185,7 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i ...@@ -185,7 +185,7 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i
} }
return '[name]' return '[name]'
}, },
libraryTarget: 'commonjs2', libraryTarget: isServer ? 'commonjs2' : 'jsonp',
hotUpdateChunkFilename: 'static/webpack/[id].[hash].hot-update.js', hotUpdateChunkFilename: 'static/webpack/[id].[hash].hot-update.js',
hotUpdateMainFilename: 'static/webpack/[hash].hot-update.json', hotUpdateMainFilename: 'static/webpack/[hash].hot-update.json',
// This saves chunks with the name given via `import()` // This saves chunks with the name given via `import()`
......
...@@ -182,7 +182,6 @@ export class NextScript extends Component { ...@@ -182,7 +182,6 @@ export class NextScript extends Component {
return ` return `
__NEXT_DATA__ = ${htmlescape(__NEXT_DATA__)} __NEXT_DATA__ = ${htmlescape(__NEXT_DATA__)}
module={}
__NEXT_LOADED_PAGES__ = [] __NEXT_LOADED_PAGES__ = []
__NEXT_REGISTER_PAGE = function (route, fn) { __NEXT_REGISTER_PAGE = function (route, fn) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment