web-infra-dev / rspack

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

Improve analyzing of magical comment `import(/* webpackChunkName: "d" */ "./d")` #2806

Closed hyf0 closed 1 year ago

hyf0 commented 1 year ago

What problem does this feature solve?

Expected improvements:

Thanks to @lalexdotcom, who proposes these improvements.

Guidance

You should improve the regexp in

https://github.com/web-infra-dev/rspack/blob/99bec3fec54dbea969c157a8236938235ad1b8c2/crates/rspack_plugin_javascript/src/visitors/dependency/scanner.rs#L101-L103

https://jex.im/regulex should be very helpful for writing the regexp.

Read https://github.com/web-infra-dev/rspack/issues/2688 for more details.

What does the proposed API of configuration look like?

.

suxin2017 commented 1 year ago

Can you assign this to me?

hyf0 commented 1 year ago

Can you assign this to me?

Thank you in advance.