Skip to content

Commit

Permalink
fix: url-dependency pos error
Browse files Browse the repository at this point in the history
  • Loading branch information
JSerFeng committed Jan 22, 2024
1 parent 84a6c7c commit 8f26d7c
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"
}
}
}
};

0 comments on commit 8f26d7c

Please sign in to comment.