我是webpack的新手,并且在我的项目中包含了引导程序。如果我使用样式加载器,则会收到“未定义文档的引用错误”,否则,如果删除样式加载器然后运行它,在这种情况下,我在bootstrap.css文件“:root”中将“:”错误
const path = require('path');
const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: './server/index.js',
target: 'node',
externals: [nodeExternals()],
output: {
path: path.resolve('server-build'),
filename: 'index.js'
},
module: {
rules: [
{
test: /\.js$|jsx/,
use: 'babel-loader'
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
}
]
}
};