-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
postcss-loader does not support hot module replacement #541
Comments
postcss-loader never supports hot module replacement, here missed hot part of code and should be fixed in place there hot code was added, sorry impossible to fix here |
Especial please read |
Do you mean |
Something wrong in nuxt, css-loader also doesn't has hot code, only |
I think this due because nuxt has own hot module replacement code for CSS |
Well, Nuxt is definitely not to blame because it is just a 30 lines of code which adds postcss to build, and nothing more. https://github.com/nuxt/postcss8/blob/main/src/index.ts - that is all, no logic there, just inclusion in build. Actually there is no nuxt module in path -
|
Because they can be used for any env (even bundle CSS code for libraries for Node.js), only |
After examining actual webpack config I found that Sample of loader chain"use": [
{
"loader": "/node_modules/vue-style-loader/index.js",
"options": {
"sourceMap": true
}
},
{
"loader": "/node_modules/@nuxt/postcss8/node_modules/css-loader/dist/cjs.js",
"options": {
"esModule": false,
"modules": {
"localIdentName": "[local]_[hash:base64:5]"
},
"sourceMap": true,
"importLoaders": 2
}
},
{
"loader": "/node_modules/@nuxt/postcss8/node_modules/postcss-loader/dist/cjs.js",
"options": {
"sourceMap": true,
"postcssOptions": {
"plugins": [
{
"postcssPlugin": "postcss-import"
},
{
"postcssPlugin": "postcss-url"
},
null,
null,
{
"postcssPlugin": "postcss-mixins"
},
{
"postcssPlugin": "tailwindcss/nesting"
},
{
"postcssPlugin": "tailwindcss",
"plugins": [
null
]
},
{
"postcssPlugin": "autoprefixer",
"options": {}
}
]
}
}
}
] |
Please open an issue in |
This is a duplicate of nuxt/postcss8#18 because this bug is not a fault of Nuxt postcss module, but of postcss-loader itself.
Expected Behavior
Page does a hot reload when stylesheets are modified.
Actual Behavior
Page does a full reload instead of hot reload when stylesheets are modified. Relevant warnings are:
Code
N/A, see reproduction repository
How Do We Reproduce?
npm install
npm run dev
assets/css/main.css
The text was updated successfully, but these errors were encountered: