web-infra-dev / rspack

The fast Rust-based web bundler with webpack-compatible API 🦀️
https://rspack.dev
MIT License
9.87k stars 571 forks source link

[Bug]: Incorrect pattern substitution #8010

Closed elsassph closed 1 month ago

elsassph commented 1 month ago

System Info

  System:
    OS: macOS 14.6.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 256.13 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
    npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
    pnpm: 9.4.0 - ~/.nvm/versions/node/v18.17.1/bin/pnpm
    bun: 1.0.15 - ~/.bun/bin/bun
  Browsers:
    Chrome: 129.0.6668.60
    Safari: 17.6
  npmPackages:
    @rspack/core: 1.0.5 => 1.0.5 
    @rspack/dev-server: ~1.0.5 => 1.0.7 

Details

Porting a Webpack config, we had these patterns:

sourceMapFilename: '[name].[contenthash].sha.js.map',
assetModuleFilename: '[name].[contenthash].sha.[ext]'

With RSpack:

I'm not sure those are RSpack bugs, intended differences, or Webpack being more clever.

Reproduce link

No response

Reproduce Steps

n/a

inottn commented 1 month ago

Based on my testing, this behavior is consistent with webpack's behavior.

LingyuCoder commented 1 month ago

According to this test project, it has been aligned with webpack. So this issue will be closed.