faceyspacey / webpack-flush-chunks

💩 server-to-client chunk discovery + transportation for Universal Rendering
MIT License
355 stars 33 forks source link

Raw CSS on development environment #85

Open kelvien opened 5 years ago

kelvien commented 5 years ago

I'm using webpack-flush-chunks version 2.0.3 I noticed these lines of code:

css: {
      toString: function toString() {
        return (
          // lazy-loaded in case not used
          DEV ? api.styles.toString() : '<style>' + stylesAsString(stylesheets, outputPath) + '</style>'
        );
      }
    }

Is there a particular reason why we are only showing raw CSS on non-DEV environment only? I just thought that it is better to return the raw CSS regardless of the environment. And use the exposed styles variable to get the linked stylesheets, the way it is now. Doing this will make us see in dev as closely as possible with what we are going to see in production.

Thank you!