Webpack:ReferenceError:文档未定义样式加载器

时间:2020-08-14 11:31:01

标签: reactjs webpack react-bootstrap

我是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'
      }
    ]
  }
};

0 个答案:

没有答案