Skip to content

Commit

Permalink
Allow same * destination
Browse files Browse the repository at this point in the history
  • Loading branch information
WebReflection committed Nov 5, 2024
1 parent ac3f3f8 commit 4f458c0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion esm/interpreter/_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const calculateFilesPaths = files => {
else {
const url = parseTemplate(source, map);
const path = fillName(url, parseTemplate(dest || './', map));
if (targets.has(path))
if (targets.has(path) && !path.endsWith('/*'))
throw new SyntaxError(`Duplicated destination: ${path}`);
targets.add(path);
sourceDest.push({ url, path });
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@
"to-json-callback": "^0.1.1"
},
"worker": {
"blob": "sha256-q3F8S0fpbtQrs9PkgOIbLQeYahmzu3z2eABsNHH1zMo="
"blob": "sha256-y6/jxBwsS9vdnsnAT+1dSKY8MQMctwF5QUikF6che60="
}
}
Binary file added test/issue-2240/a.zip
Binary file not shown.
Binary file added test/issue-2240/b.zip
Binary file not shown.
11 changes: 11 additions & 0 deletions test/issue-2240/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="module" src="../../dist/index.js"></script>
<script type="micropython" config="settings.json">
import a, b
</script>
</head>
</html>
6 changes: 6 additions & 0 deletions test/issue-2240/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"files": {
"a.zip": "./*",
"b.zip": "./*"
}
}

0 comments on commit 4f458c0

Please sign in to comment.