1.0.0 • Published 9 years ago
babel-plugin-modules-map v1.0.0
babel-plugin-modules-map
Map configuration for modules, as a Babel plugin. Rewrites module specifiers to apply aliases.
For example, this code:
import mod from 'foo';Will be transformed into:
import mod from 'bar';When using the config: {foo: 'bar'}.
Install
yarn add babel-plugin-modules-map --devUsage
In your .babelrc add:
{
"plugins": [
["modules-web-compat", {
"foo": "bar"
}]
]
}The second argument being your map configuration. A map is like an alias from one name to another. Partial matches are also applied so that:
import mod from 'foo/baz';With the config:
{
"plugins": [
["modules-web-compat", {
"foo": "bar"
}]
]
}Will become:
import mod from 'bar/baz';License
BSD 2 Clause
1.0.0
9 years ago