Skip to content

Commit

Permalink
fix: url-dependency pos error (#5397)
Browse files Browse the repository at this point in the history
  • Loading branch information
JSerFeng authored Jan 22, 2024
1 parent c443d48 commit 800542b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl JavascriptParserPlugin for URLPlugin {
start,
end,
expr.span.real_lo(),
expr.span.hi().0,
expr.span.real_hi(),
request.into(),
Some(expr.span.into()),
self.relative,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a {}
4 changes: 4 additions & 0 deletions packages/rspack/tests/configCases/asset-url/relative/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
it("should compile", () => {
const url = new URL("./index.css?query=yes#fragment", import.meta.url).href;
expect(url).toBeDefined();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/** @type {import("@rspack/core").Configuration} */
module.exports = {
mode: "development",
devtool: false,
output: {
assetModuleFilename: "[name][ext][query][fragment]",
publicPath: "public/"
},
module: {
parser: {
javascript: {
url: "relative"
}
}
}
};

1 comment on commit 800542b

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Benchmark detail: Open

name base current %
10000_development-mode + exec 1.67 s ± 17 ms 1.67 s ± 14 ms +0.14%
10000_development-mode_hmr + exec 997 ms ± 3.1 ms 1 s ± 11 ms +0.67%
10000_production-mode + exec 2.75 s ± 92 ms 2.68 s ± 29 ms -2.46%
threejs_development-mode_10x + exec 2.03 s ± 19 ms 2.02 s ± 25 ms -0.54%
threejs_development-mode_10x_hmr + exec 1.32 s ± 12 ms 1.33 s ± 6.2 ms +0.88%
threejs_production-mode_10x + exec 6.08 s ± 98 ms 5.98 s ± 110 ms -1.52%

Please sign in to comment.