diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index 3cf137781..3c27696e9 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -41,6 +41,7 @@ module.exports = { // This means they will be the "root" imports that are included in JS bundle. // The first two entry points enable "hot" CSS and auto-refreshes for JS. entry: [ + 'core-js/es6/symbol', // We ship a few polyfills by default: require.resolve('./polyfills'), // Include an alternative client for WebpackDevServer. A client's job is to @@ -90,7 +91,18 @@ module.exports = { // https://github.com/facebookincubator/create-react-app/issues/290 // `web` extension prefixes have been added for better support // for React Native Web. - extensions: ['.web.ts', '.ts', '.web.tsx', '.tsx', '.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'], + extensions: [ + '.web.ts', + '.ts', + '.web.tsx', + '.tsx', + '.web.js', + '.mjs', + '.js', + '.json', + '.web.jsx', + '.jsx', + ], alias: { // @remove-on-eject-begin // Resolve Babel runtime relative to react-scripts. diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 8badecf54..e8dfdc0ee 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -64,7 +64,11 @@ module.exports = { // You can exclude the *.map files from the build during deployment. devtool: shouldUseSourceMap ? 'source-map' : false, // In production, we only want to load the polyfills and the app code. - entry: [require.resolve('./polyfills'), paths.appIndexJs], + entry: [ + 'core-js/es6/symbol', + require.resolve('./polyfills'), + paths.appIndexJs, + ], output: { // The build folder. path: paths.appBuild, @@ -96,7 +100,18 @@ module.exports = { // https://github.com/facebookincubator/create-react-app/issues/290 // `web` extension prefixes have been added for better support // for React Native Web. - extensions: ['.web.ts', '.ts', '.web.tsx', '.tsx', '.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'], + extensions: [ + '.web.ts', + '.ts', + '.web.tsx', + '.tsx', + '.web.js', + '.mjs', + '.js', + '.json', + '.web.jsx', + '.jsx', + ], alias: { // @remove-on-eject-begin // Resolve Babel runtime relative to react-scripts. @@ -151,6 +166,7 @@ module.exports = { { test: /\.(ts|tsx)$/, include: paths.appSrc, + use: [ { loader: require.resolve('ts-loader'), diff --git a/packages/react-scripts/template/tsconfig.json b/packages/react-scripts/template/tsconfig.json index 58294bb97..a99139099 100644 --- a/packages/react-scripts/template/tsconfig.json +++ b/packages/react-scripts/template/tsconfig.json @@ -15,7 +15,8 @@ "noImplicitAny": true, "strictNullChecks": true, "suppressImplicitAnyIndexErrors": true, - "noUnusedLocals": true + "noUnusedLocals": true, + "downlevelIteration": true }, "exclude": [ "node_modules",