A babel plugin to transform aliases which also works with meteor. It also works with webpack and ava etc.
npm install babel-plugin-aliasesA babel plugin to transform aliases which also works with meteor.
It also works with webpack and ava etc.
> npm i --D babel-plugin-aliases
``json`
{
"plugins": [
["babel-plugin-aliases", [{
"path": "/some/deep/path",
"alias": "alias"
}]]
]
}
This will transform all import statements that have alias at the beginning to a relative path.
Imagine there is a file inside /some/path/file.js
`js`
import module from 'alias/file.js';
This will transform into
`js``
import module from '../deep/path/file.js';