How to add babel-plugin-transform-imports
See original GitHub issueCan you explain how to use this: https://github.com/GoogleChromeLabs/webpack-libs-optimizations/blob/master/README.md#react-router in my config-overrides.js
?
I need to use babel-plugin-transform-imports to strip unused modules:
// .babelrc
{
"plugins": [
["transform-imports", {
"react-router": {
"transform": "react-router/${member}",
"preventFullImport": true
}
}]
]
}
in:
module.exports = override(
...addBabelPlugin('transform-imports')
);
HOW TO?
I’will PR the Readme
file with your answer for newbies like me.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
babel-plugin-transform-imports - npm
Start using babel-plugin-transform-imports in your project by running `npm i babel-plugin-transform-imports`. There are 149 other projects ...
Read more >babel-plugin-transform-imports - GitHub
babel -plugin-transform-imports. Transforms member style imports: import { Row, Grid as MyGrid } ...
Read more >babel-plugin-transform-imports/README.md - UNPKG
1, # babel-plugin-transform-imports. 2. 3, Transforms member style imports: 4. 5, ```javascript. 6, import { Row, Grid as MyGrid } from 'react-bootstrap';.
Read more >babel/plugin-transform-modules-commonjs
This plugin transforms ECMAScript modules to CommonJS. Note that only the syntax of import/export statements ( import "./mod.js" ) and import expressions ...
Read more >babel-plugin-transform-import - npm package - Snyk
babel -plugin-transform-import · Transforms member style imports (import {x} from 'y') into default style imports (import x from 'y/lib/x') For ...
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 Free
Top 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
You just have to pass the plugin configuration like you’d do in normal webpack.
Ok, thanks, but I have problem with this line:
I think is not a valid javascript code.
If I use instead this one:
it complains about
member is not defined
of course.I think I’m missing something. But what?