vue project to pick up aliases file

This method is more vue cli3 version

Create a new file vue.config.js

Then add this code inside

module.exports = {
    configureWebpack: {
        resolve: {
            Alias: { // configure an alias, modified need to be recompiled to take effect 
                'Assets':' @ / Assets' ,
                 'the Common': '@ / the Common' ,
                 'Components':' @ / Components' ,
                 'Network': ' @ / Network ' ,
                 ' views': '@ / views' ,
            }
        }
    }
}

Figure:

 

 Configuring an Alias ​​need to re-run the program to take effect

Guess you like

Origin www.cnblogs.com/lyt0207/p/12096064.html