-
-
Notifications
You must be signed in to change notification settings - Fork 618
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: source-map-devtool-plugin file context option (#8888)
- Loading branch information
Showing
3 changed files
with
37 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...ack-test-tools/tests/configCases/plugins/source-map-dev-tool-plugin-file-context/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
it("should generate correct relative sourceMappingURL when fileContext is passed", function () { | ||
var fs = require("fs"), | ||
path = require("path"); | ||
var source = fs.readFileSync(path.join(__dirname, "main.js"), "utf-8"); | ||
expect(source).toMatch("//# sourceMappingURL=http://localhost:50505/sourcemaps/../main.js.map"); | ||
}); |
19 changes: 19 additions & 0 deletions
19
...-tools/tests/configCases/plugins/source-map-dev-tool-plugin-file-context/rspack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const rspack = require("@rspack/core"); | ||
|
||
/** @type {import("@rspack/core").Configuration} */ | ||
module.exports = { | ||
node: { | ||
__dirname: false, | ||
__filename: false | ||
}, | ||
output: { | ||
filename: "[name].js" | ||
}, | ||
plugins: [ | ||
new rspack.SourceMapDevToolPlugin({ | ||
filename: "sourcemaps/[file].map", | ||
fileContext: 'assets', | ||
publicPath: 'http://localhost:50505/' | ||
}) | ||
] | ||
}; |
aeb444f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Benchmark detail: Open