Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Fix filtering by extension for js assets #1722

Merged
merged 4 commits into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ fn it_builds_with_webpack_name_output() {
build_creates_assets(&fixture, vec!["script.js"]);

let out = fs::read_to_string(fixture.get_output_path().join("script.js")).unwrap();
assert!(out.contains(r#"//# sourceMappingURL=worker.js.map{"version":3,"file":"worker.js""#));
Electroid marked this conversation as resolved.
Show resolved Hide resolved
assert!(out.contains(r#"//# sourceMappingURL=worker.js.map"#));
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion wranglerjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function warn(...msg) {
}

function filterByExtension(ext) {
return v => v.indexOf("." + ext) !== -1;
return v => new RegExp(`.${ext}$`).test(v);
}

(async function() {
Expand Down