vue项目中引用样式文件出现:
This dependency was not found:
* common/stylus/index.styl in ./src/main.js
To install it, you can run: npm install --save common/stylus/index.styl
解决办法:
在 build\webpack.base.conf.js中
resolve添加 'common': resolve('src/common'),如下:
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'common': resolve('src/common')//此处为添加内容
}
},
This dependency was not found:
* common/stylus/index.styl in ./src/main.js
To install it, you can run: npm install --save common/stylus/index.styl
解决办法:
在 build\webpack.base.conf.js中
resolve添加 'common': resolve('src/common'),如下:
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'common': resolve('src/common')//此处为添加内容
}
},
Vue项目样式文件引用问题
本文介绍了在Vue项目中遇到的样式文件引用错误,并提供了解决方案。通过修改webpack配置文件,添加别名来正确引入样式资源。
3894

被折叠的 条评论
为什么被折叠?



