Skip to content

Commit

Permalink
Redisable require.ensure() (facebook#3121)
Browse files Browse the repository at this point in the history
  • Loading branch information
everdimension authored and Timer committed Jan 11, 2018
1 parent bce0d66 commit 758cdc3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
13 changes: 6 additions & 7 deletions packages/eslint-config-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,12 @@ module.exports = {
'valid-typeof': 'warn',
'no-restricted-properties': [
'error',
// TODO: reenable once import() is no longer slow.
// https://github.com/facebookincubator/create-react-app/issues/2176
// {
// object: 'require',
// property: 'ensure',
// message: 'Please use import() instead. More info: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#code-splitting',
// },
{
object: 'require',
property: 'ensure',
message:
'Please use import() instead. More info: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#code-splitting',
},
{
object: 'System',
property: 'import',
Expand Down
5 changes: 2 additions & 3 deletions packages/react-scripts/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ module.exports = {
module: {
strictExportPresence: true,
rules: [
// TODO: Disable require.ensure as it's not a standard language feature.
// We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176.
// { parser: { requireEnsure: false } },
// Disable require.ensure as it's not a standard language feature.
{ parser: { requireEnsure: false } },

// First, run the linter.
// It's important to do this before Babel processes the JS.
Expand Down
5 changes: 2 additions & 3 deletions packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ module.exports = {
module: {
strictExportPresence: true,
rules: [
// TODO: Disable require.ensure as it's not a standard language feature.
// We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176.
// { parser: { requireEnsure: false } },
// Disable require.ensure as it's not a standard language feature.
{ parser: { requireEnsure: false } },

// First, run the linter.
// It's important to do this before Babel processes the JS.
Expand Down

0 comments on commit 758cdc3

Please sign in to comment.