@jsenv/core 41.4.26 → 41.4.28
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/build/build.js +29 -14
- package/dist/build/jsenv_core_packages.js +18 -12
- package/dist/start_dev_server/browserslist_index/browserslist_index.js +5805 -0
- package/dist/start_dev_server/jsenv_core_packages.js +2125 -2070
- package/dist/start_dev_server/start_dev_server.js +40 -19
- package/package.json +2 -2
- package/src/build/build.js +2 -2
- package/src/build/build_params.js +0 -13
- package/src/dev/start_dev_server.js +15 -5
- package/src/plugins/import_meta_css/jsenv_plugin_import_meta_css.js +28 -0
- /package/dist/build/{browserslist_index/browserslist_index.js → browserslist_index_1/browserslist_index2.js} +0 -0
package/dist/build/build.js
CHANGED
|
@@ -8360,6 +8360,12 @@ const jsenvPluginImportMetaCss = () => {
|
|
|
8360
8360
|
return null;
|
|
8361
8361
|
}
|
|
8362
8362
|
if (urlInfo.context.build) {
|
|
8363
|
+
if (hasModuleScopeAssignment(urlInfo.contentAst)) {
|
|
8364
|
+
urlInfo.contentSideEffects.push({
|
|
8365
|
+
has: true,
|
|
8366
|
+
reason: "import.meta.css assigned at module scope",
|
|
8367
|
+
});
|
|
8368
|
+
}
|
|
8363
8369
|
const packageName = urlInfo.packageName;
|
|
8364
8370
|
const packageDirectoryUrl =
|
|
8365
8371
|
urlInfo.packageDirectoryUrl || urlInfo.context.rootDirectoryUrl;
|
|
@@ -8403,6 +8409,28 @@ const jsenvPluginImportMetaCss = () => {
|
|
|
8403
8409
|
};
|
|
8404
8410
|
};
|
|
8405
8411
|
|
|
8412
|
+
// A stylesheet assigned at module scope is adopted when the module runs: that
|
|
8413
|
+
// assignment IS the module's side effect. It has to be told, because a
|
|
8414
|
+
// package.json "sideEffects" list is authoritative once it exists — a module
|
|
8415
|
+
// it does not name is dropped whole when it is imported for nothing else, and
|
|
8416
|
+
// its css silently leaves the build.
|
|
8417
|
+
const hasModuleScopeAssignment = (ast) => {
|
|
8418
|
+
for (const node of ast.body) {
|
|
8419
|
+
if (node.type !== "ExpressionStatement") {
|
|
8420
|
+
continue;
|
|
8421
|
+
}
|
|
8422
|
+
const { expression } = node;
|
|
8423
|
+
if (
|
|
8424
|
+
expression.type === "AssignmentExpression" &&
|
|
8425
|
+
expression.operator === "=" &&
|
|
8426
|
+
getImportMetaPropertyName(expression.left) === "css"
|
|
8427
|
+
) {
|
|
8428
|
+
return true;
|
|
8429
|
+
}
|
|
8430
|
+
}
|
|
8431
|
+
return false;
|
|
8432
|
+
};
|
|
8433
|
+
|
|
8406
8434
|
const babelPluginRewriteImportMetaCssAssignment = (
|
|
8407
8435
|
{ types: t },
|
|
8408
8436
|
{ relativeUrl },
|
|
@@ -10489,19 +10517,6 @@ const determineCategory = (buildRelativeUrl) => {
|
|
|
10489
10517
|
return "other";
|
|
10490
10518
|
};
|
|
10491
10519
|
|
|
10492
|
-
// default runtimeCompat corresponds to
|
|
10493
|
-
// "we can keep <script type="module"> intact":
|
|
10494
|
-
// so script_type_module + dynamic_import + import_meta
|
|
10495
|
-
const defaultRuntimeCompat = {
|
|
10496
|
-
// android: "8",
|
|
10497
|
-
chrome: "64",
|
|
10498
|
-
edge: "79",
|
|
10499
|
-
firefox: "67",
|
|
10500
|
-
ios: "12",
|
|
10501
|
-
opera: "51",
|
|
10502
|
-
safari: "11.3",
|
|
10503
|
-
samsung: "9.2",
|
|
10504
|
-
};
|
|
10505
10520
|
const logsDefault = {
|
|
10506
10521
|
level: "info",
|
|
10507
10522
|
animated: true,
|
|
@@ -13230,7 +13245,7 @@ entryPoints: {
|
|
|
13230
13245
|
const entryPointDefaultParams = {
|
|
13231
13246
|
buildRelativeUrl: undefined,
|
|
13232
13247
|
mode: undefined,
|
|
13233
|
-
runtimeCompat:
|
|
13248
|
+
runtimeCompat: undefined,
|
|
13234
13249
|
plugins: [],
|
|
13235
13250
|
mappings: undefined,
|
|
13236
13251
|
assetsDirectory: undefined,
|
|
@@ -6611,18 +6611,24 @@ const startMonitoringMemoryUsage = () => {
|
|
|
6611
6611
|
return result;
|
|
6612
6612
|
};
|
|
6613
6613
|
|
|
6614
|
-
//
|
|
6615
|
-
//
|
|
6616
|
-
//
|
|
6614
|
+
// The floor a browser project targets when it says nothing: high enough that
|
|
6615
|
+
// the css jsenv and its components write is shipped as written — nesting,
|
|
6616
|
+
// light-dark(), and the module features that keep <script type="module">,
|
|
6617
|
+
// importmap and top-level await intact. light-dark() is the last gate to
|
|
6618
|
+
// close, and Safari 17.5 is where it does, so it sets the line; the other
|
|
6619
|
+
// runtimes are their releases of that same moment.
|
|
6620
|
+
//
|
|
6621
|
+
// Raising it further is a matter of moving that line, not of adding runtimes:
|
|
6622
|
+
// a project needing a lower one declares "browserslist" in its package.json or
|
|
6623
|
+
// passes runtimeCompat, and both dev and build read it.
|
|
6617
6624
|
const browserDefaultRuntimeCompat = {
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
samsung: "9.2",
|
|
6625
|
+
chrome: "125",
|
|
6626
|
+
edge: "125",
|
|
6627
|
+
firefox: "126",
|
|
6628
|
+
ios_safari: "17.5",
|
|
6629
|
+
opera: "110",
|
|
6630
|
+
safari: "17.5",
|
|
6631
|
+
samsung: "25",
|
|
6626
6632
|
};
|
|
6627
6633
|
|
|
6628
6634
|
const nodeDefaultRuntimeCompat = {
|
|
@@ -7010,7 +7016,7 @@ const inferRuntimeCompatFromClosestPackage = async (
|
|
|
7010
7016
|
if (!browserslistQuery) {
|
|
7011
7017
|
return null;
|
|
7012
7018
|
}
|
|
7013
|
-
const namespace = await import("./
|
|
7019
|
+
const namespace = await import("./browserslist_index_1/browserslist_index2.js");
|
|
7014
7020
|
const browserslist = namespace.default;
|
|
7015
7021
|
const browserslistResult = browserslist(browserslistQuery);
|
|
7016
7022
|
const runtimeCompat = {};
|