Redisable require.ensure() (#3121)

This commit is contained in:
everdimension
2018-01-10 04:38:54 +03:00
committed by Joe Haddad
parent 3c3547f942
commit 813584ff35
3 changed files with 10 additions and 13 deletions

View File

@@ -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',

View File

@@ -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.

View File

@@ -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.