The title pretty much covers my issue but what I'm basically wanting is
- Specific babel plugin runs to convert my es6 import statements to the appropriate paths
- Eslint runs telling me if there are issues with my code, which includes if there are any paths that are unresolvable
- The rest of babel gets run converting my code from es6 to es5
- Complete
Is this feasible?
Update
I'm using https://github.com/michaelzoidl/babel-root-import
//.babelrc
{
...,
"plugins": [["babel-root-import", {
"rootPathSuffix": "./src"
}]],
...
}
And in my webpack config I have a babel loader and an eslint loader like so
//webpack.config.dev.js
module: {
loaders: [{
test: /\.js$/,
loaders: ['babel', 'eslint'],
include: path.join(__dirname, 'src'),
exclude: /node_modules/
},
...
}
After this I can then import modules using a syntax like
import Module from '~/components/Module'
rather than
import Module from '../../components/Module