File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -150,19 +150,21 @@ private function resolveImportMapPackages($phpPackage): array
150
150
151
151
foreach ($ packageJson ->read ()['symfony ' ]['importmap ' ] ?? [] as $ importMapName => $ constraintConfig ) {
152
152
if (\is_string ($ constraintConfig )) {
153
- // Case "jquery": "^3.0" | "@mybundle/script.js": "path:%PACKAGE%/script.js"
153
+ // Matches string constraint, like "^3.0" or "path:%PACKAGE%/script.js"
154
154
$ constraint = $ constraintConfig ;
155
155
$ package = $ importMapName ;
156
156
$ entrypoint = false ;
157
157
} 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}
159
159
// Note that non-path assets can't be entrypoint
160
160
$ constraint = $ constraintConfig ['version ' ] ?? '' ;
161
161
$ package = $ constraintConfig ['package ' ] ?? $ importMapName ;
162
162
$ entrypoint = $ constraintConfig ['entrypoint ' ] ?? false ;
163
163
}
164
164
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"}
166
168
if (0 === strpos ($ constraint , 'entrypoint: ' )) {
167
169
$ entrypoint = true ;
168
170
$ constraint = str_replace ('entrypoint: ' , 'path: ' , $ constraint );
You can’t perform that action at this time.
0 commit comments