我今天使用新的vue-cli创建了工程,但是我却不能像之前那样使用import正常的引入css(scss),一直报错提示我需要安装依赖。比如我引用element-ui theme,在main.js里import 'element-ui/lib/theme-chalk/index.css'就报以下的错误
This dependency was not found:
The same error:
import BootstrapVue from 'bootstrap-vue';
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap-vue/dist/bootstrap-vue.css';
Vue.use(BootstrapVue);
These dependencies were not found:
- bootstrap/dist/css/bootstrap.css in ./src/main.js
- bootstrap-vue/dist/bootstrap-vue.css in ./src/main.js
To install them, you can run: npm install --save bootstrap/dist/css/bootstrap.css bootstrap-vue/d
手动安装一下 postcss-loader 应该就好了
npm install postcss-loader --save -D
Yep, postloader somehow got lost during a merge of a feature. I just added it in develop and will push an update shortly.
害人不浅啊,我就是说昨天我按照element-ui的官方文档做没有问题,今天要进入正式项目就出问题了,百思不得其解,原来是新模板的问题!好像爆粗!!!!!!
同样问题
it takes me hours to search the reasons , you can do
npm install postcss-loader --save -D
@caolingxiong 新模板的问题现在解决了么
@PanJiaChen 安装了npm install postcss-loader --save -D 依然不行
安装了npm install postcss-loader --save -D . 然后重新启动项目,发现webpack.base.conf.js文件下,
{
test: /.css$/,
loaders: ["style-loader", "css-loader", "postcss-loader"],
include: [] //没有加这个include
},
所以就会一直报错
安装了npm install postcss-loader --save -D . 然后重新启动项目,发现webpack.base.conf.js文件下,
{
test: /.css$/,
loaders: ["style-loader", "css-loader", "postcss-loader"],
include: [] //没有加这个include
},
所以就会一直报错
It works for me,thx
Most helpful comment
手动安装一下
postcss-loader应该就好了