-
-
Notifications
You must be signed in to change notification settings - Fork 384
CSS file is not emitted on incremental rebuild in watch mode #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
same happens with webpack-serve |
Also I can confirm that it doesn't work for incremental builds. |
I dug into this a little bit over the weekend so hopefully this is helpful in someway. I noticed the same issue mentioned above but if I pass along a hash here then I can get it to re-emit the css file. However, the new output isn't the correct updated output, just the same file but rewritten(updated timestamp). I tried to trace through webpack to get an idea of whats supposed to be happening and somewhere around here it ends up replacing the new module with the cached version. I am pretty new to the inner workings of webpack so I'm not sure if that is intended. Anyways, still digging... |
Hopefully @sokra got an idea. |
Playing with hashes doesn't help either. This issue makes watch mode development completely impossible... |
Same problem here. Get's really annoying as I have to restart the whole webpack process every single time I change a single line in CSS. Can't imagine being the only one having this problem as I'm using a pretty standard webpack config. |
Please don't post here unless you have something new to share. Otherwise other people following this issue will get email spam for no real and useful reason. It would be good to give a thumbs up for other commenters if you face a similar situation etc. :-) |
@manuelbieh looking on this now 😃@piehei yeah 👏 As dirty hack for now disabling const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
// disabling cache in watch mode
cache: false,
plugins: [
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "[name].css",
chunkFilename: "[id].css"
})
],
module: {
rules: [
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader"
]
}
]
}
} |
@manuelbieh As an alternative workaround, I'm using Not sure if it makes a difference, but I'm targeting Electron... webpack.config.js
|
Will use ExtractTextWebpackPlugin until this is fixed. Not really happy about that but at least it seems to work for me for the time being. Thanks for your help! 🙂 |
If someone addresses this issue, it would be nice if there would be a hook that is called when the CSS changes. That way you can send a message to the browser that it needs to reload the CSS. See also webpack-contrib/extract-text-webpack-plugin#577 |
This makes it real slow, but at least don't have to stop the server webpack-contrib/mini-css-extract-plugin#23
This makes it real slow, but at least don't have to stop the server webpack-contrib/mini-css-extract-plugin#23
Also, this branch is unmergeable due to a bug in the mini-css-extract-plugin, wherein [no updated CSS file is emitted in watch mode](webpack-contrib/mini-css-extract-plugin#23). As a result, the project can't upgrade to webpack 4 either.
Looks like it is fixed with webpack 4.4.1 + mini-css-extract-plugin 0.4.0. Thanks! |
Using style-loader was just a temporary workaround until webpack-contrib/mini-css-extract-plugin#23 was fixed.
Using style-loader was just a temporary workaround until webpack-contrib/mini-css-extract-plugin#23 was fixed.
Using style-loader was just a temporary workaround until webpack-contrib/mini-css-extract-plugin#23 was fixed.
Using style-loader was just a temporary workaround until webpack-contrib/mini-css-extract-plugin#23 was fixed.
This is not the same issue but I'm having the problem with I put together an example repo here. If you run the webpack task twice, i.e. https://github.com/dtothefp/hard-cache-mini-css-webpack-4 And there is already an issue thread started 29 days ago that doesn't seem to have generated much response |
Also, this branch is unmergeable due to a bug in the mini-css-extract-plugin, wherein [no updated CSS file is emitted in watch mode](webpack-contrib/mini-css-extract-plugin#23). As a result, the project can't upgrade to webpack 4 either.
Also, this branch is unmergeable due to a bug in the mini-css-extract-plugin, wherein [no updated CSS file is emitted in watch mode](webpack-contrib/mini-css-extract-plugin#23). As a result, the project can't upgrade to webpack 4 either.
Also, this branch is unmergeable due to a bug in the mini-css-extract-plugin, wherein [no updated CSS file is emitted in watch mode](webpack-contrib/mini-css-extract-plugin#23). As a result, the project can't upgrade to webpack 4 either.
Problem reappeared with:
When changing CSS files all files are generated. It happens only if I change JS files and at first with the second "watched change". Then only JS files are generated. Webpack output then is:
Simplified webpack.config.js:
Any other information I should give? |
BTW: |
Same. |
css wasn't being updated as it should have been disabled cache in watch mode per suggestion here: webpack-contrib/mini-css-extract-plugin#23 (comment) allowed for side effects for the same reason
Using mini-css-extract-plugin 0.2.0 with webpack 4.1.0 with this config and -watch option:
Initial build works fine and outputs css bundle as expected. Whenever i change my scss file, an incremental rebuild is triggered and this changed scss file is clearly shown in the console output, but somehow the emitted css bundle is not changed from the initial build. If i rerun the build from scratch, the changes are correctly propagated to filesystem. Here is an output after incremental rebuild.
The text was updated successfully, but these errors were encountered: