Modifying js babel loader
See original GitHub issueI’d like to modify the JS babel loader, so that I can tweak the excludes / includes and run the loader against some of my node_modules - I’m using some ES6 modules which allow this and will allow me to import only required parts of a library instead of whole bundled files.
I understand how to use modifyWebpackConfig
in order to do this, but ideally I’d like to use Gatsby’s own babelConfig generator rather than having to reproduce this. The trouble is this relies on the program
variable which doesn’t seem to be accessible within gatsby-node.js
. Is this possible currently? Or would it be better to add some kind of configuration to allow tweaking of the include + exclude of the babel-loader?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
babel-loader - webpack
This package allows transpiling JavaScript files using Babel and webpack. Note: Issues with the output should be reported on the Babel Issues tracker....
Read more >Configure Babel
Babel can be configured! Many other tools have similar configs: ESLint ( .eslintrc ), Prettier ( .prettierrc ). All Babel API options are...
Read more >How to Webpack 5 with Babel - Setup Tutorial
Exercises: · Install a Babel Plugin via npm to your project to support an upcoming JavaScript feature · Add the Plugin to your...
Read more >Upgrading to Babel-loader 8 from 7? What do I need to change?
All plugins are moved to @babel scope with Babel 7. To update your package.json, you need to rename all your plugins and presets...
Read more >Advanced Features: Customizing Babel Config - Next.js
Next.js includes the next/babel preset to your app, which includes everything needed to compile React applications and server-side code.
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
Glad you figured it out! This looks like a great example – could you add it to the docs?
https://www.gatsbyjs.org/docs/add-custom-webpack-config/
Forgot to return the promise! This is working now, hopefully someone else will find it useful: