@jsenv/core 38.0.4 → 38.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jsenv_core.js +28 -5
- package/package.json +9 -9
- package/src/build/build.js +12 -4
package/dist/jsenv_core.js
CHANGED
|
@@ -400,13 +400,28 @@ const injectQueryParams = (url, params) => {
|
|
|
400
400
|
const urlWithParams = urlObject.href;
|
|
401
401
|
return normalizeUrl(urlWithParams);
|
|
402
402
|
};
|
|
403
|
+
|
|
404
|
+
const injectQueryParamWithoutEncoding = (url, key, value) => {
|
|
405
|
+
const urlObject = new URL(url);
|
|
406
|
+
let { origin, pathname, search, hash } = urlObject;
|
|
407
|
+
// origin is "null" for "file://" urls with Node.js
|
|
408
|
+
if (origin === "null" && urlObject.href.startsWith("file:")) {
|
|
409
|
+
origin = "file://";
|
|
410
|
+
}
|
|
411
|
+
if (search === "") {
|
|
412
|
+
search = `?${key}=${value}`;
|
|
413
|
+
} else {
|
|
414
|
+
search += `${key}=${value}`;
|
|
415
|
+
}
|
|
416
|
+
return `${origin}${pathname}${search}${hash}`;
|
|
417
|
+
};
|
|
403
418
|
const injectQueryParamIntoSpecifierWithoutEncoding = (
|
|
404
419
|
specifier,
|
|
405
420
|
key,
|
|
406
421
|
value,
|
|
407
422
|
) => {
|
|
408
423
|
if (isValidUrl$1(specifier)) {
|
|
409
|
-
return
|
|
424
|
+
return injectQueryParamWithoutEncoding(specifier, key, value);
|
|
410
425
|
}
|
|
411
426
|
const [beforeQuestion, afterQuestion = ""] = specifier.split("?");
|
|
412
427
|
const searchParams = new URLSearchParams(afterQuestion);
|
|
@@ -21343,9 +21358,17 @@ build "${entryPointKeys[0]}"`);
|
|
|
21343
21358
|
logger.info(`
|
|
21344
21359
|
build ${entryPointKeys.length} entry points`);
|
|
21345
21360
|
}
|
|
21346
|
-
|
|
21347
|
-
|
|
21348
|
-
|
|
21361
|
+
let explicitJsModuleConversion = false;
|
|
21362
|
+
for (const entryPointKey of entryPointKeys) {
|
|
21363
|
+
if (entryPointKey.includes("?js_module_fallback")) {
|
|
21364
|
+
explicitJsModuleConversion = true;
|
|
21365
|
+
break;
|
|
21366
|
+
}
|
|
21367
|
+
if (entryPointKey.includes("?as_js_classic")) {
|
|
21368
|
+
explicitJsModuleConversion = true;
|
|
21369
|
+
break;
|
|
21370
|
+
}
|
|
21371
|
+
}
|
|
21349
21372
|
const rawRedirections = new Map();
|
|
21350
21373
|
const entryUrls = [];
|
|
21351
21374
|
const contextSharedDuringBuild = {
|
|
@@ -21390,7 +21413,7 @@ build ${entryPointKeys.length} entry points`);
|
|
|
21390
21413
|
magicDirectoryIndex,
|
|
21391
21414
|
directoryReferenceAllowed,
|
|
21392
21415
|
transpilation: {
|
|
21393
|
-
babelHelpersAsImport: !
|
|
21416
|
+
babelHelpersAsImport: !explicitJsModuleConversion,
|
|
21394
21417
|
...transpilation,
|
|
21395
21418
|
jsModuleFallback: false,
|
|
21396
21419
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "38.0.
|
|
3
|
+
"version": "38.0.5",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -61,22 +61,22 @@
|
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@financial-times/polyfill-useragent-normaliser": "1.10.2",
|
|
63
63
|
"@jsenv/abort": "4.2.4",
|
|
64
|
-
"@jsenv/ast": "5.1.
|
|
65
|
-
"@jsenv/filesystem": "4.2.
|
|
64
|
+
"@jsenv/ast": "5.1.1",
|
|
65
|
+
"@jsenv/filesystem": "4.2.6",
|
|
66
66
|
"@jsenv/importmap": "1.2.1",
|
|
67
67
|
"@jsenv/integrity": "0.0.1",
|
|
68
68
|
"@jsenv/log": "3.4.0",
|
|
69
69
|
"@jsenv/node-esm-resolution": "1.0.1",
|
|
70
|
-
"@jsenv/js-module-fallback": "1.3.
|
|
70
|
+
"@jsenv/js-module-fallback": "1.3.2",
|
|
71
71
|
"@jsenv/runtime-compat": "1.2.0",
|
|
72
72
|
"@jsenv/server": "15.1.0",
|
|
73
|
-
"@jsenv/sourcemap": "1.2.
|
|
74
|
-
"@jsenv/plugin-bundling": "2.5.
|
|
73
|
+
"@jsenv/sourcemap": "1.2.1",
|
|
74
|
+
"@jsenv/plugin-bundling": "2.5.1",
|
|
75
75
|
"@jsenv/plugin-minification": "1.5.0",
|
|
76
|
-
"@jsenv/plugin-transpilation": "1.3.
|
|
77
|
-
"@jsenv/plugin-supervisor": "1.3.
|
|
76
|
+
"@jsenv/plugin-transpilation": "1.3.1",
|
|
77
|
+
"@jsenv/plugin-supervisor": "1.3.1",
|
|
78
78
|
"@jsenv/url-meta": "8.1.0",
|
|
79
|
-
"@jsenv/urls": "2.2.
|
|
79
|
+
"@jsenv/urls": "2.2.1",
|
|
80
80
|
"@jsenv/utils": "2.0.1"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
package/src/build/build.js
CHANGED
|
@@ -237,9 +237,17 @@ build "${entryPointKeys[0]}"`);
|
|
|
237
237
|
logger.info(`
|
|
238
238
|
build ${entryPointKeys.length} entry points`);
|
|
239
239
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
let explicitJsModuleConversion = false;
|
|
241
|
+
for (const entryPointKey of entryPointKeys) {
|
|
242
|
+
if (entryPointKey.includes("?js_module_fallback")) {
|
|
243
|
+
explicitJsModuleConversion = true;
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
if (entryPointKey.includes("?as_js_classic")) {
|
|
247
|
+
explicitJsModuleConversion = true;
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
243
251
|
const rawRedirections = new Map();
|
|
244
252
|
const entryUrls = [];
|
|
245
253
|
const contextSharedDuringBuild = {
|
|
@@ -284,7 +292,7 @@ build ${entryPointKeys.length} entry points`);
|
|
|
284
292
|
magicDirectoryIndex,
|
|
285
293
|
directoryReferenceAllowed,
|
|
286
294
|
transpilation: {
|
|
287
|
-
babelHelpersAsImport: !
|
|
295
|
+
babelHelpersAsImport: !explicitJsModuleConversion,
|
|
288
296
|
...transpilation,
|
|
289
297
|
jsModuleFallback: false,
|
|
290
298
|
},
|