-
Notifications
You must be signed in to change notification settings - Fork 7
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
Exclude node_modules from babel-loader #5
Comments
Great questions, the webpack.config.js is generated by reapp-pack, which is run by the command line interface based on the various build or run configs you have. I've worked on some documentation in both the getting started and reapp-pack repos, but need to make it better. You can see your generated config if you add the debug flag to your command ( As far as excluding node_modules. It's a great idea and should be configurable. For now we just offer being able to replace all the loaders we provide wholesale, so you could do that. I really want to exclude node_modules as well, but at the moment some of the reapp- modules are not ready for this. Basically, we need to create a build script for them when are ready for them to be published npm that will transform them to be node-compatable. They use some babel features. I'm 100% for doing this, it's just a lot of work. One weekend I'll find the time though. It would save huge amounts of time off builds. I definitely want it to be done before the 1.0. If you're willing to help I'd say go for it! Reapp-ui is the big one, it needs to maintain it's current structure, but be compiled before release. I think the react-router guys have some of this figured out. Something like putting everything in a /src directory and then on build it copies them all to the flat structure. |
@lazywei I just released reapp 0.8.6 with a fix for this. Since I use ES6 syntax pretty extensively in reapp-ui and a couple other reapp modules, and it would be a huge task and long-term overhead to convert them and maintain them without ES6, I came up with something different. By default, reapp will now exclude everything in your package.json dependencies, except for a few reapp packages I've hardcoded. If you want another package parsed by babel, you can add an option for reapp-pack I tested it out on our Kitchen sink and saw a roughly 7 second speedup on compile times (from ~17s - 10s) which is pretty awesome. Thanks for reminding me about this. Let me know how it works for you. |
Awesome! I agree with you. I also use ES6 a lot, but turns out there are still some legacy packages that don't leverage ES6. I think this is indeed a good solution to exclude all my own However, I think it is still necessary to build (either via gulp or webpack) reapp when releasing to npm. I'm also willing to help with this, and maybe we can start from provide a build script for reapp-ui? How do you think? Thanks. |
It will automatically exclude all your npm modules besides the ones reapp needs, so you should get nearly full speedup. I agree on building before going to npm but it is more work than I can afford. The problem is not getting the build to work, but also how it would affect my workflow. For example in
For me, that's a big overhead, and being a solo developer I need to be as effective as possible. If you have any thoughts I'd be open. Honestly I thought about just converting them back to non-es6 syntax, but I realized how much nicer my code is with it. |
is it possible to have a config, so in development mode, it use src/ folder, in production mode, it use build/ folder? |
When using reapp UI you do a lot of |
Actually this has been fixed! Build times are far faster now. |
Actually two questions here:
webpack.config.js
that is used byreapp run
? Is there a default config forreapp run
?Thanks.
The text was updated successfully, but these errors were encountered: