Skip to content

Commit 06029f7

Browse files
JibbarthKocal
andauthored
Improve comments
Co-authored-by: Hugo Alliaume <[email protected]>
1 parent 20f3f73 commit 06029f7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/PackageJsonSynchronizer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,16 @@ private function resolveImportMapPackages($phpPackage): array
155155
$package = $importMapName;
156156
$entrypoint = false;
157157
} else {
158-
// Case "jquery": {"version": "^3.0"} | "@mybundle/script.js": {"version": "path:%PACKAGE%/script.js", "entrypoint": true}
158+
// Matches array constraint, like {"version":"^3.0"} or {"version":"path:%PACKAGE%/script.js","entrypoint":true}
159159
// Note that non-path assets can't be entrypoint
160160
$constraint = $constraintConfig['version'] ?? '';
161161
$package = $constraintConfig['package'] ?? $importMapName;
162162
$entrypoint = $constraintConfig['entrypoint'] ?? false;
163163
}
164164

165-
// Case "@mybundle/script.js": "entrypoint:%PACKAGE%/script.js" | "@mybundle/script.js": {"version": "entrypoint:%PACKAGE%/script.js"}
165+
// When "$constraintConfig" matches one of the following cases:
166+
// - "entrypoint:%PACKAGE%/script.js"
167+
// - {"version": "entrypoint:%PACKAGE%/script.js"}
166168
if (0 === strpos($constraint, 'entrypoint:')) {
167169
$entrypoint = true;
168170
$constraint = str_replace('entrypoint:', 'path:', $constraint);

0 commit comments

Comments
 (0)