3

React CSS style is rendering later than custom CSS style, which is somehow dependent on minChunks.

new webpack.optimize.CommonsChunkPlugin({
    name: "common",
    minChunks: function(module, count) {
        return !couldThisGoToCommonBundle(module) && count >= 5;
    }
}),

new webpack.optimize.CommonsChunkPlugin({
    name: 'vendor',
    chunks: Object.keys(entryPoints).concat('common'),
    minChunks: function(module, count) {
        return couldThisGoToCommonBundle(module) && count >= 10;
    }
})

When I change the count >= 5 in vendor, the custom style is not distorted.

Decade Moon
  • 32,968
  • 8
  • 81
  • 101
Ashutosh Ranjan
  • 642
  • 5
  • 12
  • 1
    This might have something to do with CSS specificity of the styles. Have you written the CSS selectors such that the order in which the styles are defined does not matter? You shouldn't assume the styles will be defined in a particular order (at least when chunking and doing various transformations through webpack). – Decade Moon Jul 12 '17 at 12:35

0 Answers0