Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 如何加快babel启动时间_Reactjs_Babeljs_Next.js_Babel Polyfill - Fatal编程技术网

Reactjs 如何加快babel启动时间

Reactjs 如何加快babel启动时间,reactjs,babeljs,next.js,babel-polyfill,Reactjs,Babeljs,Next.js,Babel Polyfill,我继承了使用NextJS的React应用程序,我注意到开发过程中的启动时间有点慢。巴贝尔有哪些选项可以加快开发的启动时间 在我的index.js文件中,我有: require('@babel/register')({ presets: ['@babel/preset-env'], ignore: ['node_modules'] }); module.exports = require('./server.js'); 在server.js中,我有: import "@bab

我继承了使用NextJS的React应用程序,我注意到开发过程中的启动时间有点慢。巴贝尔有哪些选项可以加快开发的启动时间

在我的
index.js
文件中,我有:

require('@babel/register')({
  presets: ['@babel/preset-env'],
  ignore: ['node_modules']
});

module.exports = require('./server.js');
server.js
中,我有:

import "@babel/polyfill";
...
My package.json正在导入:

...
"@babel/core": "^7.12.7",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.12.7",
"@babel/register": "^7.12.1",
...
我看不出巴别塔还有其他用途。我通过使用
DEBUG=“*”npm run dev
运行我的应用程序来确定due babel的速度。我看到大量的巴别塔原木,如:

...
  babel program.body[4].declarations[0].init.left.object MemberExpression: enter +0ms
  babel program.body[4].declarations[0].init.left.object MemberExpression: Recursing into... +0ms
  babel program.body[4].declarations[0].init.left.object.object Identifier: enter +0ms
  babel program.body[4].declarations[0].init.left.object.object Identifier: Recursing into... +0ms
  babel program.body[4].declarations[0].init.left.object.object Identifier: exit +0ms
  babel program.body[4].declarations[0].init.left.object.property Identifier: enter +0ms
  babel program.body[4].declarations[0].init.left.object.property Identifier: Recursing into... +0ms
  babel program.body[4].declarations[0].init.left.object.property Identifier: exit +0ms
  babel program.body[4].declarations[0].init.left.object MemberExpression: exit +0ms
  babel program.body[4].declarations[0].init.left.property Identifier: enter +0ms
  babel program.body[4].declarations[0].init.left.property Identifier: Recursing into... +0ms
...then...
  babel:config:config-chain No config is applied to "/Users/michael/repos/MyApp/node_modules/braces/lib/parse.js" because it matches one of `ignore: ["node_modules"]` from "/Users/michael/repos/MyApp" +0ms
  babel:config:config-chain No config is applied to "/Users/michael/repos/MyApp/node_modules/braces/lib/constants.js" because it matches one of `ignore: ["node_modules"]` from "/Users/michael/repos/MyApp" +1ms
  babel:config:config-chain No config is applied to "/Users/michael/repos/MyApp/node_modules/chokidar/lib/nodefs-handler.js" because it matches one of `ignore: ["node_modules"]` from "/Users/michael/repos/MyApp" +0ms
  babel:config:config-chain No config is applied to "/Users/michael/repos/MyApp/node_modules/is-binary-path/index.js" because it matches one of `ignore: ["node_modules"]` from "/Users/michael/repos/MyApp" +2ms
  babel:config:config-chain No config is applied to "/Users/michael/repos/MyApp/node_modules/binary-extensions/index.js" because it matches one of `ignore: ["node_modules"]` from "/Users/michael/repos/MyApp" +0ms
  babel:config:config-chain No config is applied to "/Users/michael/repos/MyApp/node_modules/chokidar/lib/constants.js" because it matches one of `ignore: ["node_modules"]` from "/Users/michael/repos/MyApp" +1ms
  babel:config:config-chain No config is applied to "/Users/michael/repos/MyApp/node_modules/chokidar/lib/fsevents-handler.js" because it matches one of `ignore: ["node_modules"]` from "/Users/michael/repos/MyApp" +1ms
...