I had one and the same problem: in css production they are extracted, therefore it always works, however in development because of the style-loader "sometimes executed after the main package" I had problems when the main package calculated the size of some nodes in the DOM, which was installed by css ... so this can lead to incorrect sizes, since the main css is still loaded ... I fixed this problem by selecting the singleton:true option.
Example:
{ test: /\.s?css$/, loader: ExtractTextPlugin.extract({ fallback: [ { loader: 'style-loader', options: { singleton: true } } ], use: [ { loader: 'css-loader', options: { importLoaders: 1, minimize: !isProduction, sourceMap: !isProduction } }, { loader: 'postcss-loader', options: { sourceMap: !isProduction, ...postcss } }, { loader: 'resolve-url-loader', options: { sourceMap: !isProduction } }, { loader: 'sass-loader', options: { sourceMap: true } } ] } ) }
source share