-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[4.0.0.rc.1 / 4.0.0.rc.2] Doesn't allow non-transpiled JS. #1857
Comments
@tylercrocker Yes, to comply with ES5 standard and support all evergreen browsers, we now transpile all modules even from // environment.js
environment.loaders.delete('nodeModules') I guess you can delete |
Or perhaps we can have that as a config option. |
@gauravtiwari OK, so I'd have to delete the |
OK, I tested adding
To my environment.js file, got excited cause it seemed to work, then I realized that I was still on pre.3 :( So I'm still stuck at square one... |
Could you use this api please?
|
Ohhhhh! Ok, yes, that worked! Thank you :) So to confirm for anyone coming across this... What I had to do was add this line to environment.js:
Though then if you need anything transpiled in
(I dunno that I need to do that REGEXP exactly... I want to say at some point I had issues with SASS files and I didn't want it to try to transpile itself. I've been using that REGEXP with Webpacker for like a year now though.) It DOES seem like this solution is a little bit wonky... If you want to be able to have multiple pack files (one that is transpiled and one that is not) then you have to do what I'm doing here (then calling Honestly, just changing the babel loader's default exclude property to transpile node_modules by default, rather than excluding it then re-including it the way it's being done now? |
I agree this is a bit tricky and would probably need documentation, and maybe a global configuration option to control what is excluded from the The thing is that it is a quite common need to exclude the whole console.log(environment.loaders.get('babel').exclude) // => /node_modules/ But instead it is loaded by As a practical example, the popular |
fixes rails/rails#35501 fixes rails#2131 fixes rails/rails#36278 fixes rails#2407 fixes rails#2114 fixes rails#1949 fixes rails#1865 fixes rails#1857
fixes rails/rails#35501 fixes #2131 fixes rails/rails#36278 fixes #2407 fixes #2114 fixes #1949 fixes #1865 fixes #1857
fixes rails/rails#35501 fixes rails/webpacker#2131 fixes rails/rails#36278 fixes rails/webpacker#2407 fixes rails/webpacker#2114 fixes rails/webpacker#1949 fixes rails/webpacker#1865 fixes rails/webpacker#1857
fixes rails/rails#35501 fixes rails/webpacker#2131 fixes rails/rails#36278 fixes rails/webpacker#2407 fixes rails/webpacker#2114 fixes rails/webpacker#1949 fixes rails/webpacker#1865 fixes rails/webpacker#1857
I have a number of apps that are either for personal use or are behind a login wall and my company can enforce modern browser usage, so I prefer to not bother with Babel transpiling my code for these apps. This has worked fine up to 4.0.0-pre.3 by just not including the babel line at the top and telling the loader to exclude everything (or just deleting the loader entirely I think works as well). With a new project I'm working on I ended up getting rc.2 and suddenly it appears that javascript ALWAYS gets transpiled for some reason, regardless of what I do.
Is there some setting I missed that I can use to tell Babel to leave my code alone? I noticed the new
extract_css
setting, but I'm not seeing anything similar for the transpiling stuff.Thanks!
The text was updated successfully, but these errors were encountered: