Open giannif opened 7 years ago
Ran into this recently. To get around the issue I created a separate alias file webpack.alias.js
and added the resolve property to its export:
module.exports = {
resolve: {
alias: {
something: 'something'
}
}
};
From your .babelrc you can specify that this plugin use this file.
From within your webpack config(s) require this file and set your main config's resolve to this object:
...
resolve: {
alias: resolve.resolve.alias
},
...
Webpack 2 supports exporting a default function as the webpack config.
I'm using this for the reasons in this post.
babel-plugin-webpack-alias
will need to check for a function, invoke it (potentially with the valueenv
), to get the config object, before it checks ifconfig.resolve
existsOtherwise you get the
'The resolved config file doesn\'t contain a resolve configuration'
error