Loader code not transpiled with babel
See original GitHub issueThe loader code injected by this plugin is not compatible with older browsers dues to ES6 syntax.
rollup-babel-plugin
will not transpile the code as it uses the transform
rollup plugin hook rather than the renderChunk
hook - see here a discussion about this problem with wrapper code: https://github.com/rollup/rollup-plugin-babel/issues/303
Wondering if there is any known method to get the loader/wrapper code transpiled with babel so I can use it in my build which targets older browsers?
General guidelines are that node module outputs should not require transpilation (although I understand that you are generally targeting browsers with worker support here…) - perhaps the loader code could be switched out for a transpiled version?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6 (3 by maintainers)
Top Results From Across the Web
babel-loader does not transpile es6 scripts to es5 · Issue #249
Recently I have used Babel and Webpack but I have noticed babel-loader does not transpile es6 scripts to es5. On the other hand,...
Read more >webpack code not transpiling to ES5 - Stack Overflow
So I've gone through a few variations of configs now and for some reason certain webpack code is not being transpiled to es5...
Read more >babel-loader - npm
Exclude libraries that should not be transpiled. core-js and webpack/buildin will cause errors if they are transpiled by Babel. You will need to ......
Read more >Why and how to transpile dependencies of your JavaScript ...
In both cases, you need to transpile the code of the dependencies. Manual transpilation. Let's assume that we're using webpack and babel-loader.
Read more >How to quickly transpile JavaScript using Babel alone? A brief ...
So when a program asks @babel/core package to transpile a JavaScript program, it uses these plugins to perform transpilation of the individual ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
When I wrote the reply above, I thought I was commenting on #19. Turns out I was not 😂
I am pretty sure I am doing the right thing here and as @lukastaegert says in #19, there is a fix for the babel plugin about to land. I’ll close this as I believe it’s not actionable to me. Please re-open if you disagree 😃
Ran into this as well, decided to hand-transpile
loader.ejs
and pass that. Here’s what I’m using at the moment, can’t confirm all paths work since I’m only using 1, but I think I caught everything and made it es5-ish. In my opinion i think the plugin should switch over to es5-friendly source until there’s better support for transpiling at build time, but at least there’s support for passing a custom loader.