Normally I use
{ test: /\.sass$/, loader: 'style!css!sass?indentedSyntax' }
and then in main.js
require('./styles.sass')
But it applies style using javascript when main.js is loaded. The problem is that my app us isomorphic and returns some html initially. Because I load main.js just before </body> tag, then styles are applied to document a bit too late (user sees not-styled HTML for a moment).
Therefore I would like to generate regular css file from styles.sass and then simply include id in <head></head> to make sure it is loaded initially. How I can generate regular css file?
I tried:
entry: {
styles: path.resolve(__dirname, 'app/styles.sass')
}
but it generates styles.js instead of .css file. Moreover if I include styles.js in a head then I get following error in console from styles.js:
Uncaught ReferenceError: webpackJsonp is not defined