GithubHelp home page GithubHelp logo

Super slow about babel-loader HOT 9 CLOSED

babel avatar babel commented on August 15, 2024
Super slow

from babel-loader.

Comments (9)

jamiebuilds avatar jamiebuilds commented on August 15, 2024

@jmeas mind trying to compile them without webpack and timing it?

$ npm install -g 6to5
$ { time ( 6to5 src/**/*.js -d dist ) } 2>&1

from babel-loader.

jamesplease avatar jamesplease commented on August 15, 2024

real 0m0.818s
user 0m0.725s
sys 0m0.070s

but I think it's an inaccurate number...it only picked up some of the files in src for whatever reason.

from babel-loader.

jamiebuilds avatar jamiebuilds commented on August 15, 2024

Yeah, there's no way that's right. Can you see if you can get a more accurate number?

from babel-loader.

jamesplease avatar jamesplease commented on August 15, 2024

I tried; no dice.

from babel-loader.

jamesplease avatar jamesplease commented on August 15, 2024

The build becomes basically instant when I don't use the last suggestion in the "Usage" part of the README.

tl;dr, do not default to loading all .js files with 6to5. I'm thinking that each and every module that imports, say, Backbone, will cause the library to be compiled with 6to5, which adds up quickly.

from babel-loader.

jamesplease avatar jamesplease commented on August 15, 2024

So, I thought that the above was the solution, but I'm honestly not too sure. Gonna open for the discussion to continue. Has anyone else had speed issues, or is it just me?

from babel-loader.

Couto avatar Couto commented on August 15, 2024

Weird, I've never noticed any slowness, at least significative.

Anyway my computer has been completely broke, so I had to getting it fixed, and I've been accumulating issues as a consequence.
Luckily it should be ready by next saturday, when I will take the time to measure this and check all the other issues.

Sorry for the inconvenience.

from babel-loader.

jamesplease avatar jamesplease commented on August 15, 2024

The solution is to not build the node modules. #5 resolves it, but it's pretty specific and not configurable (for instance, there's no option to toggle the behavior, nor a way to expand it to, say, bower components).

from babel-loader.

jamesplease avatar jamesplease commented on August 15, 2024

The best solution is probably to use the exclude option:

{test: /\.js$/, exclude: /node_modules/, loader: '6to5-loader'}

from babel-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.