Reputation: 758
I am trying to create custom alias but I get an error:
Invalid options in vue.config.js: "resolve" is not allowed
Upvotes: 2
Views: 4120
Reputation: 3604
vue.config.js
is for vue configuration for webpack you need to wrap your resolve
with either configureWebpack
or chainWebpack
, something like:
// vue.config.js
const path = require('path');
module.exports = {
configureWebpack: {
resolve: {...you config...}
}
}
configureWebpack
can be also a function, from the docs:
If you need conditional behavior based on the environment, or want to directly mutate the config, use a function (which will be lazy evaluated after the env variables are set). The function receives the resolved config as the argument. Inside the function, you can either mutate the config directly, OR return an object which will be merged:
Upvotes: 6