-
Notifications
You must be signed in to change notification settings - Fork 24k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
transformer taking too much time! #6830
Comments
Are you using npm3? It makes your node_modules much faster at runtime by deduping deps. |
yeah i am using |
You can provide a custom .babelrc file and include only the transforms you need. I'm not sure which transforms those are (maybe you don't need any transforms) but it could speed things up considerably in your case. |
@ide thanks for your reply i'll play with it and will post results here :) |
Sure thing, also I believe there's an option in the packager to specify a path to a custom transformer (search for a file called transformer.js inside of the RN repo to learn the API that you'd have to implement). This should give you a lot of control over how the code is transformed. |
@ide I modified transformer.js const result = babel.transform(src, babelConfig);
|
To
const result = filename.indexOf("index.ios.js") > -1 ? {code : src} : babel.transform(src, babelConfig); its working fine for now , can i achieve same thing without touching node_modules/* stuff! |
Yes, the packager server accepts a |
You could move the scalajs code to a different file and ignore it using |
@ide looks like it requires alot more work i'll add it my todo list , anyway thanks alot for your help, new transform times ~ 2 seconds ( even for my 5MB scala.js development mode output) :)
@satya164 it requires changes in my build script i'll try that and will let you know :) closing this issue as we have decent workaround thanks guys , react-native OSS ❤️ 💯 |
I am using react-native with scala.js ,here is the gist of my index.ios.js (dont worry about huge code its just scalajs boiler plate) and package.json files.
transform statistics :
it took almost ~20 seconds to transform for simple hello world project with no external deps.
is it because
babelTransformer
taking too much time to analyze google closure generated output! ? if yes can we bypass this because we don't need any babel magic on our file(its already in ES5)!packager experts can you please through some light on this ..
cc @vjeux
The text was updated successfully, but these errors were encountered: