Skip to content

Commit

Permalink
[webpack5] Complile for ES5 (#15708)
Browse files Browse the repository at this point in the history
I think this is necessary for IE11.

via [Webpack docs](https://webpack.js.org/migrate/5/#turn-off-es2015-syntax-in-runtime-code-if-necessary)


> By default, webpack's runtime code uses ES2015 syntax to build smaller bundles. If your build targets environments that don't support this syntax (like IE11), you'll need to set output.ecmaVersion: 5 to revert to ES5 syntax.


Thank you
  • Loading branch information
RafalFilipek authored Jul 31, 2020
1 parent 1409cd6 commit bcd1ba6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ export default async function getBaseWebpackConfig(
ignored: ['**/.git/**', '**/node_modules/**', '**/.next/**'],
},
output: {
...(isWebpack5 ? { ecmaVersion: 5 } : {}),
path: outputPath,
// On the server we don't use the chunkhash
filename: isServer
Expand Down

0 comments on commit bcd1ba6

Please sign in to comment.