web-infra-dev
rspack
BlogDocsChangelog

fix(javascript): prevent import.meta.url replacement in web target

#12266
Comparing
MIreland:fix/import-meta-url-web
(
396aa66
) with
main
(
5838590
)
CodSpeed Performance Gauge
+1%
Untouched
17

Benchmarks

Passed

rust@build_chunk_graph_parallel
xtask/benchmark/benches/groups/build_chunk_graph.rs::chunk_graph::build_chunk_graph_benchmark
CodSpeed Performance Gauge
+3%
104.8 ms102.1 ms
js@external getResolve
tests/bench/ts-react.bench.ts::TypeScript React project
CodSpeed Performance Gauge
+2%
1.5 ms1.4 ms
js@Traverse compilation.modules
tests/bench/ts-react.bench.ts::TypeScript React project
CodSpeed Performance Gauge
+2%
66 µs65 µs
js@Traverse module graph by connections
tests/bench/ts-react.bench.ts::TypeScript React project
CodSpeed Performance Gauge
+1%
262.4 µs259 µs
bundle@threejs-development
xtask/benchmark/benches/groups/bundle.rs::bundle::bundle_benchmark::bundle
CodSpeed Performance Gauge
+1%
769.8 ms760.7 ms
js@record module
tests/bench/ts-react.bench.ts::TypeScript React project
CodSpeed Performance Gauge
+1%
1.9 ms1.9 ms
rust@build_chunk_graph
xtask/benchmark/benches/groups/build_chunk_graph.rs::chunk_graph::build_chunk_graph_benchmark
CodSpeed Performance Gauge
+1%
113.2 ms112.3 ms
bundle@threejs-production-sourcemap
xtask/benchmark/benches/groups/bundle.rs::bundle::bundle_benchmark::bundle
CodSpeed Performance Gauge
+1%
2.1 s2.1 s
bundle@threejs-production
xtask/benchmark/benches/groups/bundle.rs::bundle::bundle_benchmark::bundle
CodSpeed Performance Gauge
0%
1.6 s1.6 s
js@stats.toJson()
tests/bench/ts-react.bench.ts::TypeScript React project
CodSpeed Performance Gauge
0%
24.2 ms24.1 ms
js@record chunk group
tests/bench/ts-react.bench.ts::TypeScript React project
CodSpeed Performance Gauge
0%
77.8 µs77.5 µs
js@collect imported identifiers
tests/bench/ts-react.bench.ts::TypeScript React project
CodSpeed Performance Gauge
0%
209.4 µs208.9 µs
bundle@basic-react-development
xtask/benchmark/benches/groups/bundle.rs::bundle::bundle_benchmark::bundle
CodSpeed Performance Gauge
0%
373.7 ms372.9 ms
bundle@basic-react-production
xtask/benchmark/benches/groups/bundle.rs::bundle::bundle_benchmark::bundle
CodSpeed Performance Gauge
0%
570.7 ms570.7 ms
bundle@basic-react-production-sourcemap
xtask/benchmark/benches/groups/bundle.rs::bundle::bundle_benchmark::bundle
CodSpeed Performance Gauge
0%
726 ms726.8 ms
js@Traverse module graph by dependencies
tests/bench/ts-react.bench.ts::TypeScript React project
CodSpeed Performance Gauge
-1%
511.9 µs514.8 µs
js@is css mod
tests/bench/ts-react.bench.ts::TypeScript React project
CodSpeed Performance Gauge
-1%
87.9 µs89.1 µs

Commits

Click on a commit to change the comparison range
Base
main
5838590
+0.61%
fix: check if module is ES module before using import.meta.url The script must be an ES module to use import.meta.url. We cannot use supports_document() to determine this. This change adds a check for parser.is_esm before handling import.meta.url in both evaluate_identifier and member methods.
396aa66
9 hours ago
by MIreland
© 2025 CodSpeed Technology
Home Terms Privacy Docs