vue.config.ts配置如下
export default defineConfig({
alias: {
'@': path.resolve(__dirname, 'src'),
'comp': path.resolve(__dirname, 'src/components'),
'style': path.resolve(__dirname, 'src/style'),
'api': path.resolve(__dirname, 'src/api'),
'utils': path.resolve(__dirname, 'src/utils'),
'views': path.resolve(__dirname, 'src/views'),
'routers': path.resolve(__dirname, 'src/routers'),
'config': path.resolve(__dirname, 'src/config'),
},
plugins: [vue()]
})
出现以下警告
按提示更改即可
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'comp': path.resolve(__dirname, 'src/components'),
'style': path.resolve(__dirname, 'src/style'),
'api': path.resolve(__dirname, 'src/api'),
'utils': path.resolve(__dirname, 'src/utils'),
'views': path.resolve(__dirname, 'src/views'),
'routers': path.resolve(__dirname, 'src/routers'),
'config': path.resolve(__dirname, 'src/config'),
},
},
plugins: [vue()]
})