Skip to content
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

[Bug Report]: 修改样式无法触发页面更新? #2399

Closed
dingff opened this issue Mar 21, 2023 · 6 comments
Closed

[Bug Report]: 修改样式无法触发页面更新? #2399

dingff opened this issue Mar 21, 2023 · 6 comments
Assignees
Labels
same as webpack The behavior is the same as Webpack

Comments

@dingff
Copy link

dingff commented Mar 21, 2023

System Info

System:
OS: macOS 13.2
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 6.76 GB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.21.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 6.14.18 - /usr/local/bin/npm
Browsers:
Chrome: 111.0.5563.64
Safari: 16.3

Details

使用sass和cssModules,修改样式后,页面没有更新

Reproduce link

No response

Reproduce Steps

npx rspack serve

@dingff dingff added the bug Something isn't working label Mar 21, 2023
@dingff
Copy link
Author

dingff commented Mar 21, 2023

手动刷新页面后样式是正常的

@hardfist
Copy link
Contributor

能提供最小复现demo吗

@dingff
Copy link
Author

dingff commented Mar 21, 2023

@dingff
Copy link
Author

dingff commented Mar 21, 2023

  1. npm start
  2. 在 src/pages/Index/index.module.scss 中修改样式

@jerrykingxyz
Copy link
Contributor

jerrykingxyz commented Mar 22, 2023

可以暂时先通过移除 output.filename 中的 [contenthash] 来规避

const isDev = process.env.NODE_ENV === "development";
module.exports = {
  output: {
    filename: isDev ? '[name].js' : '[name].[contenthash].js'
  }
}

@underfin
Copy link
Contributor

Related webpack/webpack-dev-server#3227

@underfin underfin added same as webpack The behavior is the same as Webpack C-workaround and removed bug Something isn't working C-workaround labels Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
same as webpack The behavior is the same as Webpack
Projects
None yet
Development

No branches or pull requests

4 participants