Skip to content

css 热更新失效 #4206

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

Closed
noshower opened this issue Sep 17, 2023 · 1 comment
Closed

css 热更新失效 #4206

noshower opened this issue Sep 17, 2023 · 1 comment
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.

Comments

@noshower
Copy link
Contributor

System Info

System:

  OS: macOS 13.4.1
  CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 966.71 MB / 32.00 GB
  Shell: 5.9 - /bin/zsh

Binaries:

  Node: 16.19.1 - ~/.nvm/versions/node/v16.19.1/bin/node
  npm: 8.19.3 - ~/.nvm/versions/node/v16.19.1/bin/npm

Browsers:

  Chrome: 116.0.5845.187
  Firefox: 109.0.1
  Safari: 16.5.2

npmPackages:

  @rspack/cli: latest => 0.3.4 

Details

复现配置

只要配置了 filename 和 cssFilename ,css 热更新失效。

/**
 * @type {import('@rspack/cli').Configuration}
 */
module.exports = {
  context: __dirname,
  entry: {
    main: "./src/main.tsx",
  },
  output: {
    // 配置了 filename 和 cssFilename 后,开发环境的 css 热更新失效
    filename: "js/[name].[contenthash].js",
    cssFilename: "css/[name].[contenthash].css",
  },
  builtins: {
    html: [
      {
        template: "./index.html",
      },
    ],
  },
  module: {
    rules: [
      {
        test: /\.svg$/,
        type: "asset",
      },
    ],
  },
};

Reproduce link

No response

Reproduce Steps

复现步骤:

  1. npm create rspack@latest
  2. 给 rspack.config.js 加上以下配置
  output: {
    // 配置了 filename 和 cssFilename 后,开发环境的 css 热更新失效
    filename: "js/[name].[contenthash].js",
    cssFilename: "css/[name].[contenthash].css",
  },
  1. npm run dev
  2. 修改任一样式,样式不会热更新
@noshower noshower added bug Something isn't working pending triage The issue/PR is currently untouched. labels Sep 17, 2023
@hardfist
Copy link
Contributor

same as #3629

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.
Projects
None yet
Development

No branches or pull requests

2 participants