1
0
Fork 0
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:
Tim Neutkens 2018-09-04 17:30:01 +02:00 committed by GitHub
parent 885eee8021
commit d6c7050816
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View file

@ -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()`

View file

@ -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) {