• <bdo id='PeRT5'></bdo><ul id='PeRT5'></ul>
    1. <i id='PeRT5'><tr id='PeRT5'><dt id='PeRT5'><q id='PeRT5'><span id='PeRT5'><b id='PeRT5'><form id='PeRT5'><ins id='PeRT5'></ins><ul id='PeRT5'></ul><sub id='PeRT5'></sub></form><legend id='PeRT5'></legend><bdo id='PeRT5'><pre id='PeRT5'><center id='PeRT5'></center></pre></bdo></b><th id='PeRT5'></th></span></q></dt></tr></i><div id='PeRT5'><tfoot id='PeRT5'></tfoot><dl id='PeRT5'><fieldset id='PeRT5'></fieldset></dl></div>

      <tfoot id='PeRT5'></tfoot>

        <legend id='PeRT5'><style id='PeRT5'><dir id='PeRT5'><q id='PeRT5'></q></dir></style></legend>

      1. <small id='PeRT5'></small><noframes id='PeRT5'>

        Gulp babel es2015 转换很慢

        时间:2023-05-28

        <small id='ueNpN'></small><noframes id='ueNpN'>

        <tfoot id='ueNpN'></tfoot>
        <i id='ueNpN'><tr id='ueNpN'><dt id='ueNpN'><q id='ueNpN'><span id='ueNpN'><b id='ueNpN'><form id='ueNpN'><ins id='ueNpN'></ins><ul id='ueNpN'></ul><sub id='ueNpN'></sub></form><legend id='ueNpN'></legend><bdo id='ueNpN'><pre id='ueNpN'><center id='ueNpN'></center></pre></bdo></b><th id='ueNpN'></th></span></q></dt></tr></i><div id='ueNpN'><tfoot id='ueNpN'></tfoot><dl id='ueNpN'><fieldset id='ueNpN'></fieldset></dl></div>
          <bdo id='ueNpN'></bdo><ul id='ueNpN'></ul>

            <tbody id='ueNpN'></tbody>
          <legend id='ueNpN'><style id='ueNpN'><dir id='ueNpN'><q id='ueNpN'></q></dir></style></legend>

                1. 本文介绍了Gulp babel es2015 转换很慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在尝试使用 gulp 在我的 JavaScript 上运行 babel-preset-es2015,但即使在一行代码上也需要很长时间.我最初尝试使用大约 700 loc 的脚本包,然后使用 1 行的虚拟脚本.第一种情况大约需要 9s - 1 行 i 需要 8.38s.

                  I am trying to run the babel-preset-es2015 on my JavaScript using gulp, but it takes forever even on one line of code. I originally tried with my script bundle that is about 700 loc, and then with a dummy script that is 1 line. The first case takes about 9s - with 1 line i takes 8.38s.

                  这是我的确切设置:

                  package.json:

                  package.json:

                  {
                      "devDependencies": {
                          "gulp": "^3.9.0",
                          "gulp-babel": "^6.1.1",
                          "babel": "^6.3.26",
                          "babel-preset-es2015": "^6.3.13"
                      }, 
                     "babel": {
                         "presets": [ "es2015" ]
                      }
                  }
                  

                  gulpfile.js:

                  gulpfile.js:

                  gulp.task('js', function () {
                      return gulp.src('dummyscript.js')
                        .pipe(concat('site.bundle.js'))   
                        .pipe(babel())  
                        .pipe(gulp.dest(paths.dest.scripts));
                  
                  });
                  

                  dummy.js:

                  console.log('dummy script');
                  

                  我正在运行 node v4.2.4 和 npm v2.14.12.

                  I'm running node v4.2.4 and npm v2.14.12.

                  gulp-react 和 gulp-uglify 等其他操作加起来大约需要 180 毫秒.

                  Other operations like gulp-react and gulp-uglify all take about 180ms combined.

                  发生了什么事?

                  推荐答案

                  Babel 6 有很多高度嵌套的子依赖.如果你有一个非扁平的依赖树,这可能会很慢.在您的情况下,您使用的是 npm 2,您将需要 npm dedupe 或安装 npm@3 并重新安装,以便您的依赖项被扁平化.

                  Babel 6 has many highly-nested subdependencies. This can be quite slow if you have a non-flattened dependency tree. In your case, you are using npm 2, you will need to either npm dedupe or install npm@3 and reinstall so that your dependencies are flattened.

                  这篇关于Gulp babel es2015 转换很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:获取参数的 gulp 命令 下一篇:如何使用 gulp webpack-stream 生成正确的命名文件?

                  相关文章

                  最新文章

                2. <legend id='1MuhV'><style id='1MuhV'><dir id='1MuhV'><q id='1MuhV'></q></dir></style></legend>
                3. <i id='1MuhV'><tr id='1MuhV'><dt id='1MuhV'><q id='1MuhV'><span id='1MuhV'><b id='1MuhV'><form id='1MuhV'><ins id='1MuhV'></ins><ul id='1MuhV'></ul><sub id='1MuhV'></sub></form><legend id='1MuhV'></legend><bdo id='1MuhV'><pre id='1MuhV'><center id='1MuhV'></center></pre></bdo></b><th id='1MuhV'></th></span></q></dt></tr></i><div id='1MuhV'><tfoot id='1MuhV'></tfoot><dl id='1MuhV'><fieldset id='1MuhV'></fieldset></dl></div>
                    <bdo id='1MuhV'></bdo><ul id='1MuhV'></ul>
                    <tfoot id='1MuhV'></tfoot>

                    <small id='1MuhV'></small><noframes id='1MuhV'>