Skip to content

Commit

Permalink
Properly handle pkg: imports with args (#2193)
Browse files Browse the repository at this point in the history
Closes #2188
  • Loading branch information
nex3 committed Mar 12, 2024
1 parent 0330491 commit 9af6bbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -9,6 +9,11 @@
* When printing suggestions for variables, use underscores in variable names
when the original usage used underscores.

### JavaScript API

* Properly resolve `pkg:` imports with the Node.js package importer when
arguments are passed to the JavaScript process.

## 1.71.1

### Command-Line Interface
Expand Down
2 changes: 1 addition & 1 deletion lib/src/js/utils.dart
Expand Up @@ -239,7 +239,7 @@ Syntax parseSyntax(String? syntax) => switch (syntax) {
String? get entrypointFilename {
if (_requireMain?.filename case var filename?) {
return filename;
} else if (process.argv case [_, String path]) {
} else if (process.argv case [_, String path, ...]) {
return module.createRequire(path).resolve(path);
} else {
return null;
Expand Down

0 comments on commit 9af6bbf

Please sign in to comment.