我可以postcss-import
用于导入 Bootstrap 吗?
这是我的 webpack 配置的一部分:
{
test: /\.css$/,
loaders: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
options: {
importLoaders: 1,
modules: true,
localIdentName: '[folder]__[local]___[hash:base64:5]',
},
},
{
loader: 'postcss-loader',
},
],
},
我正在尝试导入使用 npm 安装的 Bootstap:
@import 'bootstrap/dist/css/bootstrap.css';
我有一个错误:
./~/css-loader?{"importLoaders":1,"modules":true,"localIdentName":"[folder]__[local]___[hash:base64:5]"}!./~/postcss-loader/lib!./src/css/app.css
Module not found: Error: Can't resolve '../fonts/glyphicons-halflings-regular.eot' in '/home/entry/Dev/project/src/css'
@ ./~/css-loader?{"importLoaders":1,"modules":true,"localIdentName":"[folder]__[local]___[hash:base64:5]"}!./~/postcss-loader/lib!./src/css/app.css 6:4601-4653 6:4676-4728
@ ./src/css/app.css
@ ./src/js/backoffice/index.js
@ ./src/main.js
@ multi ./scripts/config/polyfills.js ./src/main.js
./~/css-loader?{"importLoaders":1,"modules":true,"localIdentName":"[folder]__[local]___[hash:base64:5]"}!./~/postcss-loader/lib!./src/css/app.css
Module not found: Error: Can't resolve '../fonts/glyphicons-halflings-regular.woff2' in '/home/entry/Dev/project/src/css'
@ ./~/css-loader?{"importLoaders":1,"modules":true,"localIdentName":"[folder]__[local]___[hash:base64:5]"}!./~/postcss-loader/lib!./src/css/app.css 6:4778-4832
@ ./src/css/app.css
@ ./src/js/backoffice/index.js
@ ./src/main.js
@ multi ./scripts/config/polyfills.js ./src/main.js
........
我也url-loader
用作默认加载程序
{
exclude: [
/\.html$/,
/\.js$/,
/\.css$/,
/\.json$/,
],
loader: 'url-loader',
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]',
},
},
我正在使用webpack v.2.1.3、postcss-loader v.2.0.6、postcss-import v.11.0.0