I'm building a normal App (JQuery, ES6, etc) with webpack and it's usual loaders. I came across the following situation:
- In development, I wish to use the style-loader, to have my css in an inline tag.
- In production, I want to have a minified-css-bundle-file (dam, what a word), that I can cache later on and avoid FOUC. I'm using the well known Extract Text Plugin for that purpose.
The problem is, when I am in production I will need to add a
<link href="some-bundle.css" />
. OK. But by doing this, back in development I would get a 404 every time, since my css is not coming from any external source (It comes from JS and it's inline thing).
And if I don't add the link tag, i'm never getting the compiled stylesheet.
So, how do you do this? Is there any loader to auto add the
in production? Or you just manually add It later on?