mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
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.
This commit is contained in:
parent
885eee8021
commit
d6c7050816
|
@ -185,7 +185,7 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i
|
|||
}
|
||||
return '[name]'
|
||||
},
|
||||
libraryTarget: 'commonjs2',
|
||||
libraryTarget: isServer ? 'commonjs2' : 'jsonp',
|
||||
hotUpdateChunkFilename: 'static/webpack/[id].[hash].hot-update.js',
|
||||
hotUpdateMainFilename: 'static/webpack/[hash].hot-update.json',
|
||||
// This saves chunks with the name given via `import()`
|
||||
|
|
|
@ -182,7 +182,6 @@ export class NextScript extends Component {
|
|||
|
||||
return `
|
||||
__NEXT_DATA__ = ${htmlescape(__NEXT_DATA__)}
|
||||
module={}
|
||||
__NEXT_LOADED_PAGES__ = []
|
||||
|
||||
__NEXT_REGISTER_PAGE = function (route, fn) {
|
||||
|
|
Loading…
Reference in a new issue