解决vs code设置别名后路径不会自动提示
程序员文章站
2024-01-01 13:31:52
项目中webpack.base.conf.js配置自定义别名resolve: { extensions: ['.js', '.vue', '.json'], alias: { 'vue$': 'vue/dist/vue.esm.js', '@': resolve('src'), 'styles': resolve('src/assets/styles') } },在项目根目录下创建jsconfig.json文件,配置如下:{ "co...
项目中webpack.base.conf.js配置自定义别名
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'styles': resolve('src/assets/styles')
}
},
在项目根目录下创建jsconfig.json文件,配置如下:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
],
// 配置自定义的别名匹配路径
"styles/*": [
"src/assets/styles/*"
]
},
"target": "ES6",
"module": "commonjs",
"allowSyntheticDefaultImports": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"dist"
]
}
本文地址:https://blog.csdn.net/qq_15769147/article/details/107533446