window not defined error when using extract-text-webpack-plugin React

前端 未结 4 1015
闹比i
闹比i 2020-12-13 01:21

I\'m using webpack to build my react components and I\'m trying to use the extract-text-webpack-plugin to separate my css from my generated js file. However, wh

4条回答
  •  生来不讨喜
    2020-12-13 02:08

    I figured out the solution to my problem:

    Instead of piping the loaders into one another (ExtractTextPlugin.extract('style-loader!css-loader')), you have to pass in the each loader as a separate parameter: ExtractTextWebpackPlugin.extract('style-loader', 'css-loader')

提交回复
热议问题