@valbuild/tanstack-build 0.142.0 → 0.144.2
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/CHANGELOG.md +34 -0
- package/dist/declarations/src/build.d.ts +7 -0
- package/dist/declarations/src/node/vendorLayer.d.ts +14 -2
- package/dist/{regeneratorValues-637c3146.cjs.prod.js → regeneratorValues-295cad22.cjs.prod.js} +136 -0
- package/dist/{regeneratorValues-78fb2365.cjs.dev.js → regeneratorValues-5b6a1f70.cjs.dev.js} +136 -0
- package/dist/{regeneratorValues-3acdc3fe.esm.js → regeneratorValues-af449040.esm.js} +130 -1
- package/dist/valbuild-tanstack-build.cjs.dev.js +145 -145
- package/dist/valbuild-tanstack-build.cjs.prod.js +145 -145
- package/dist/valbuild-tanstack-build.esm.js +137 -136
- package/node/dist/valbuild-tanstack-build-node.cjs.dev.js +397 -172
- package/node/dist/valbuild-tanstack-build-node.cjs.prod.js +397 -172
- package/node/dist/valbuild-tanstack-build-node.esm.js +398 -173
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var regeneratorValues = require('../../dist/regeneratorValues-
|
|
5
|
+
var regeneratorValues = require('../../dist/regeneratorValues-5b6a1f70.cjs.dev.js');
|
|
6
6
|
var rolldown = require('rolldown');
|
|
7
7
|
var node_crypto = require('node:crypto');
|
|
8
8
|
var node_module = require('node:module');
|
|
@@ -450,7 +450,7 @@ function buildTargets(_x, _x2, _x3, _x4, _x5) {
|
|
|
450
450
|
*/
|
|
451
451
|
function _buildTargets() {
|
|
452
452
|
_buildTargets = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function _callee2(names, input, outRoot, quiet, platform) {
|
|
453
|
-
var out, digest,
|
|
453
|
+
var out, digest, _iterator9, _step9, target, forTarget, dir, shims, _iterator0, _step0, file, code, _t, _t2, _t3;
|
|
454
454
|
return regeneratorValues._regenerator().w(function (_context2) {
|
|
455
455
|
while (1) switch (_context2.p = _context2.n) {
|
|
456
456
|
case 0:
|
|
@@ -459,15 +459,15 @@ function _buildTargets() {
|
|
|
459
459
|
browser: {}
|
|
460
460
|
};
|
|
461
461
|
digest = node_crypto.createHash("sha256");
|
|
462
|
-
|
|
462
|
+
_iterator9 = regeneratorValues._createForOfIteratorHelper(targetsFor(platform));
|
|
463
463
|
_context2.p = 1;
|
|
464
|
-
|
|
464
|
+
_iterator9.s();
|
|
465
465
|
case 2:
|
|
466
|
-
if ((
|
|
466
|
+
if ((_step9 = _iterator9.n()).done) {
|
|
467
467
|
_context2.n = 17;
|
|
468
468
|
break;
|
|
469
469
|
}
|
|
470
|
-
target =
|
|
470
|
+
target = _step9.value;
|
|
471
471
|
forTarget = Array.isArray(names) ? names : names[target.name]; // Nothing for this side: a dependency can be server-only, and building an
|
|
472
472
|
// empty bundle is both pointless and an error.
|
|
473
473
|
if (!(forTarget.length === 0)) {
|
|
@@ -597,15 +597,15 @@ function _buildTargets() {
|
|
|
597
597
|
_context2.n = 7;
|
|
598
598
|
return promises.readdir(dir);
|
|
599
599
|
case 7:
|
|
600
|
-
|
|
600
|
+
_iterator0 = _t(_context2.v.sort());
|
|
601
601
|
_context2.p = 8;
|
|
602
|
-
|
|
602
|
+
_iterator0.s();
|
|
603
603
|
case 9:
|
|
604
|
-
if ((
|
|
604
|
+
if ((_step0 = _iterator0.n()).done) {
|
|
605
605
|
_context2.n = 13;
|
|
606
606
|
break;
|
|
607
607
|
}
|
|
608
|
-
file =
|
|
608
|
+
file = _step0.value;
|
|
609
609
|
_context2.n = 10;
|
|
610
610
|
return promises.readFile(node_path.join(dir, file), "utf8");
|
|
611
611
|
case 10:
|
|
@@ -627,10 +627,10 @@ function _buildTargets() {
|
|
|
627
627
|
case 14:
|
|
628
628
|
_context2.p = 14;
|
|
629
629
|
_t2 = _context2.v;
|
|
630
|
-
|
|
630
|
+
_iterator0.e(_t2);
|
|
631
631
|
case 15:
|
|
632
632
|
_context2.p = 15;
|
|
633
|
-
|
|
633
|
+
_iterator0.f();
|
|
634
634
|
return _context2.f(15);
|
|
635
635
|
case 16:
|
|
636
636
|
_context2.n = 2;
|
|
@@ -641,10 +641,10 @@ function _buildTargets() {
|
|
|
641
641
|
case 18:
|
|
642
642
|
_context2.p = 18;
|
|
643
643
|
_t3 = _context2.v;
|
|
644
|
-
|
|
644
|
+
_iterator9.e(_t3);
|
|
645
645
|
case 19:
|
|
646
646
|
_context2.p = 19;
|
|
647
|
-
|
|
647
|
+
_iterator9.f();
|
|
648
648
|
return _context2.f(19);
|
|
649
649
|
case 20:
|
|
650
650
|
return _context2.a(2, regeneratorValues._objectSpread2(regeneratorValues._objectSpread2({}, out), {}, {
|
|
@@ -876,7 +876,7 @@ function auditableImports(_x8, _x9) {
|
|
|
876
876
|
}
|
|
877
877
|
function _auditableImports() {
|
|
878
878
|
_auditableImports = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function _callee3(code, file) {
|
|
879
|
-
var ast, imports,
|
|
879
|
+
var ast, imports, _iterator1, _step1, _statement$source, _statement$specifiers, statement, source, names, _iterator10, _step10, specifier, name, _name, _t4;
|
|
880
880
|
return regeneratorValues._regenerator().w(function (_context3) {
|
|
881
881
|
while (1) switch (_context3.p = _context3.n) {
|
|
882
882
|
case 0:
|
|
@@ -885,15 +885,15 @@ function _auditableImports() {
|
|
|
885
885
|
case 1:
|
|
886
886
|
ast = _context3.v;
|
|
887
887
|
imports = [];
|
|
888
|
-
|
|
888
|
+
_iterator1 = regeneratorValues._createForOfIteratorHelper(ast.body);
|
|
889
889
|
_context3.p = 2;
|
|
890
|
-
|
|
890
|
+
_iterator1.s();
|
|
891
891
|
case 3:
|
|
892
|
-
if ((
|
|
892
|
+
if ((_step1 = _iterator1.n()).done) {
|
|
893
893
|
_context3.n = 7;
|
|
894
894
|
break;
|
|
895
895
|
}
|
|
896
|
-
statement =
|
|
896
|
+
statement = _step1.value;
|
|
897
897
|
if (!(statement.type !== "ImportDeclaration" && statement.type !== "ExportNamedDeclaration" && statement.type !== "ExportAllDeclaration")) {
|
|
898
898
|
_context3.n = 4;
|
|
899
899
|
break;
|
|
@@ -908,10 +908,10 @@ function _auditableImports() {
|
|
|
908
908
|
return _context3.a(3, 6);
|
|
909
909
|
case 5:
|
|
910
910
|
names = [];
|
|
911
|
-
|
|
911
|
+
_iterator10 = regeneratorValues._createForOfIteratorHelper((_statement$specifiers = statement.specifiers) !== null && _statement$specifiers !== void 0 ? _statement$specifiers : []);
|
|
912
912
|
try {
|
|
913
|
-
for (
|
|
914
|
-
specifier =
|
|
913
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
914
|
+
specifier = _step10.value;
|
|
915
915
|
if (specifier.type === "ImportDefaultSpecifier") names.push("default");else if (specifier.type === "ImportSpecifier") {
|
|
916
916
|
name = nameOf(specifier.imported);
|
|
917
917
|
if (name) names.push(name);
|
|
@@ -924,9 +924,9 @@ function _auditableImports() {
|
|
|
924
924
|
// whatever is there.
|
|
925
925
|
}
|
|
926
926
|
} catch (err) {
|
|
927
|
-
|
|
927
|
+
_iterator10.e(err);
|
|
928
928
|
} finally {
|
|
929
|
-
|
|
929
|
+
_iterator10.f();
|
|
930
930
|
}
|
|
931
931
|
imports.push({
|
|
932
932
|
source: source,
|
|
@@ -941,10 +941,10 @@ function _auditableImports() {
|
|
|
941
941
|
case 8:
|
|
942
942
|
_context3.p = 8;
|
|
943
943
|
_t4 = _context3.v;
|
|
944
|
-
|
|
944
|
+
_iterator1.e(_t4);
|
|
945
945
|
case 9:
|
|
946
946
|
_context3.p = 9;
|
|
947
|
-
|
|
947
|
+
_iterator1.f();
|
|
948
948
|
return _context3.f(9);
|
|
949
949
|
case 10:
|
|
950
950
|
return _context3.a(2, imports);
|
|
@@ -986,7 +986,7 @@ function baseChunkExports(_x10, _x11, _x12) {
|
|
|
986
986
|
}
|
|
987
987
|
function _baseChunkExports() {
|
|
988
988
|
_baseChunkExports = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function _callee5(target, specifier, platform) {
|
|
989
|
-
var dist, file, code, ast, exported,
|
|
989
|
+
var dist, file, code, ast, exported, _iterator11, _step11, _declaration$id, _statement$specifiers2, _declaration$declarat, statement, _iterator12, _step12, specifierNode, name, declaration, _iterator13, _step13, _declarator$id, declarator, _t6;
|
|
990
990
|
return regeneratorValues._regenerator().w(function (_context5) {
|
|
991
991
|
while (1) switch (_context5.p = _context5.n) {
|
|
992
992
|
case 0:
|
|
@@ -1015,15 +1015,15 @@ function _baseChunkExports() {
|
|
|
1015
1015
|
case 6:
|
|
1016
1016
|
ast = _context5.v;
|
|
1017
1017
|
exported = new Set();
|
|
1018
|
-
|
|
1018
|
+
_iterator11 = regeneratorValues._createForOfIteratorHelper(ast.body);
|
|
1019
1019
|
_context5.p = 7;
|
|
1020
|
-
|
|
1020
|
+
_iterator11.s();
|
|
1021
1021
|
case 8:
|
|
1022
|
-
if ((
|
|
1022
|
+
if ((_step11 = _iterator11.n()).done) {
|
|
1023
1023
|
_context5.n = 13;
|
|
1024
1024
|
break;
|
|
1025
1025
|
}
|
|
1026
|
-
statement =
|
|
1026
|
+
statement = _step11.value;
|
|
1027
1027
|
if (!(statement.type === "ExportAllDeclaration")) {
|
|
1028
1028
|
_context5.n = 9;
|
|
1029
1029
|
break;
|
|
@@ -1043,34 +1043,34 @@ function _baseChunkExports() {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
return _context5.a(3, 12);
|
|
1045
1045
|
case 11:
|
|
1046
|
-
|
|
1046
|
+
_iterator12 = regeneratorValues._createForOfIteratorHelper((_statement$specifiers2 = statement.specifiers) !== null && _statement$specifiers2 !== void 0 ? _statement$specifiers2 : []);
|
|
1047
1047
|
try {
|
|
1048
|
-
for (
|
|
1049
|
-
specifierNode =
|
|
1048
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
1049
|
+
specifierNode = _step12.value;
|
|
1050
1050
|
name = nameOf(specifierNode.exported);
|
|
1051
1051
|
if (name) exported.add(name);
|
|
1052
1052
|
}
|
|
1053
1053
|
// `export const x = ...` / `export function x() {}`, which a hand-written
|
|
1054
1054
|
// chunk can carry even though a bundled one usually does not.
|
|
1055
1055
|
} catch (err) {
|
|
1056
|
-
|
|
1056
|
+
_iterator12.e(err);
|
|
1057
1057
|
} finally {
|
|
1058
|
-
|
|
1058
|
+
_iterator12.f();
|
|
1059
1059
|
}
|
|
1060
1060
|
declaration = statement.declaration;
|
|
1061
1061
|
if (declaration !== null && declaration !== void 0 && (_declaration$id = declaration.id) !== null && _declaration$id !== void 0 && _declaration$id.name) exported.add(declaration.id.name);
|
|
1062
|
-
|
|
1062
|
+
_iterator13 = regeneratorValues._createForOfIteratorHelper((_declaration$declarat = declaration === null || declaration === void 0 ? void 0 : declaration.declarations) !== null && _declaration$declarat !== void 0 ? _declaration$declarat : []);
|
|
1063
1063
|
try {
|
|
1064
|
-
for (
|
|
1065
|
-
declarator =
|
|
1064
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
1065
|
+
declarator = _step13.value;
|
|
1066
1066
|
if (((_declarator$id = declarator.id) === null || _declarator$id === void 0 ? void 0 : _declarator$id.type) === "Identifier" && declarator.id.name) {
|
|
1067
1067
|
exported.add(declarator.id.name);
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
1070
|
} catch (err) {
|
|
1071
|
-
|
|
1071
|
+
_iterator13.e(err);
|
|
1072
1072
|
} finally {
|
|
1073
|
-
|
|
1073
|
+
_iterator13.f();
|
|
1074
1074
|
}
|
|
1075
1075
|
case 12:
|
|
1076
1076
|
_context5.n = 8;
|
|
@@ -1081,10 +1081,10 @@ function _baseChunkExports() {
|
|
|
1081
1081
|
case 14:
|
|
1082
1082
|
_context5.p = 14;
|
|
1083
1083
|
_t6 = _context5.v;
|
|
1084
|
-
|
|
1084
|
+
_iterator11.e(_t6);
|
|
1085
1085
|
case 15:
|
|
1086
1086
|
_context5.p = 15;
|
|
1087
|
-
|
|
1087
|
+
_iterator11.f();
|
|
1088
1088
|
return _context5.f(15);
|
|
1089
1089
|
case 16:
|
|
1090
1090
|
return _context5.a(2, exported);
|
|
@@ -1124,7 +1124,7 @@ function auditImports(_x13, _x14, _x15, _x16) {
|
|
|
1124
1124
|
*/
|
|
1125
1125
|
function _auditImports() {
|
|
1126
1126
|
_auditImports = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function _callee6(target, file, code, platform) {
|
|
1127
|
-
var
|
|
1127
|
+
var _iterator14, _step14, _step14$value, specifier, names, intoBase, intoSelf, builtin, _t7, _t8;
|
|
1128
1128
|
return regeneratorValues._regenerator().w(function (_context6) {
|
|
1129
1129
|
while (1) switch (_context6.p = _context6.n) {
|
|
1130
1130
|
case 0:
|
|
@@ -1132,15 +1132,15 @@ function _auditImports() {
|
|
|
1132
1132
|
_context6.n = 1;
|
|
1133
1133
|
return auditableImports(code, file);
|
|
1134
1134
|
case 1:
|
|
1135
|
-
|
|
1135
|
+
_iterator14 = _t7(_context6.v);
|
|
1136
1136
|
_context6.p = 2;
|
|
1137
|
-
|
|
1137
|
+
_iterator14.s();
|
|
1138
1138
|
case 3:
|
|
1139
|
-
if ((
|
|
1139
|
+
if ((_step14 = _iterator14.n()).done) {
|
|
1140
1140
|
_context6.n = 6;
|
|
1141
1141
|
break;
|
|
1142
1142
|
}
|
|
1143
|
-
|
|
1143
|
+
_step14$value = _step14.value, specifier = _step14$value.source, names = _step14$value.names;
|
|
1144
1144
|
intoBase = specifier.startsWith(target.baseFrom);
|
|
1145
1145
|
intoSelf = specifier.startsWith("./") || specifier.startsWith("../pvendor/"); // Only the worker target: a browser has no Node builtins, and a chunk that
|
|
1146
1146
|
// reached for one there is a genuine error rather than a runtime import.
|
|
@@ -1166,10 +1166,10 @@ function _auditImports() {
|
|
|
1166
1166
|
case 7:
|
|
1167
1167
|
_context6.p = 7;
|
|
1168
1168
|
_t8 = _context6.v;
|
|
1169
|
-
|
|
1169
|
+
_iterator14.e(_t8);
|
|
1170
1170
|
case 8:
|
|
1171
1171
|
_context6.p = 8;
|
|
1172
|
-
|
|
1172
|
+
_iterator14.f();
|
|
1173
1173
|
return _context6.f(8);
|
|
1174
1174
|
case 9:
|
|
1175
1175
|
return _context6.a(2);
|
|
@@ -1181,7 +1181,14 @@ function _auditImports() {
|
|
|
1181
1181
|
function auditBaseExports(_x17, _x18, _x19, _x20, _x21) {
|
|
1182
1182
|
return _auditBaseExports.apply(this, arguments);
|
|
1183
1183
|
}
|
|
1184
|
-
/**
|
|
1184
|
+
/**
|
|
1185
|
+
* A stylesheet's bare `@import`s -- `@import "@fontsource-variable/inter";` --
|
|
1186
|
+
* which name a package's stylesheet whether or not they end in `.css`.
|
|
1187
|
+
*
|
|
1188
|
+
* Not `tailwindcss`, which Tailwind resolves from its own inlined sheets, and
|
|
1189
|
+
* not a URL. Comments are stripped first, so an `@import` in a comment does not
|
|
1190
|
+
* pull a package in.
|
|
1191
|
+
*/
|
|
1185
1192
|
function _auditBaseExports() {
|
|
1186
1193
|
_auditBaseExports = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function _callee7(target, file, specifier, names, platform) {
|
|
1187
1194
|
var exported, missing;
|
|
@@ -1217,24 +1224,65 @@ function _auditBaseExports() {
|
|
|
1217
1224
|
}));
|
|
1218
1225
|
return _auditBaseExports.apply(this, arguments);
|
|
1219
1226
|
}
|
|
1227
|
+
function cssImportSpecifiersOf(css) {
|
|
1228
|
+
var found = [];
|
|
1229
|
+
var code = css.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
1230
|
+
var _iterator2 = regeneratorValues._createForOfIteratorHelper(code.matchAll(/@import\s+(?:url\(\s*)?(["'])([^"']+)\1/g)),
|
|
1231
|
+
_step2;
|
|
1232
|
+
try {
|
|
1233
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
1234
|
+
var match = _step2.value;
|
|
1235
|
+
var specifier = match[2];
|
|
1236
|
+
if (/^[./]/.test(specifier)) continue;
|
|
1237
|
+
if (/^tailwindcss(\/|$)/.test(specifier)) continue;
|
|
1238
|
+
if (/^([a-z]+:)?\/\//i.test(specifier)) continue;
|
|
1239
|
+
found.push(specifier);
|
|
1240
|
+
}
|
|
1241
|
+
} catch (err) {
|
|
1242
|
+
_iterator2.e(err);
|
|
1243
|
+
} finally {
|
|
1244
|
+
_iterator2.f();
|
|
1245
|
+
}
|
|
1246
|
+
return found;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
/**
|
|
1250
|
+
* Bare specifiers that point at a stylesheet rather than a module: a `.css`
|
|
1251
|
+
* file a module imports, or anything a stylesheet `@import`s.
|
|
1252
|
+
*/
|
|
1220
1253
|
function cssSpecifiersOf(files) {
|
|
1221
1254
|
var found = new Set();
|
|
1222
1255
|
for (var _i = 0, _Object$entries = Object.entries(files); _i < _Object$entries.length; _i++) {
|
|
1223
1256
|
var _Object$entries$_i = regeneratorValues._slicedToArray(_Object$entries[_i], 2),
|
|
1224
1257
|
path = _Object$entries$_i[0],
|
|
1225
1258
|
code = _Object$entries$_i[1];
|
|
1259
|
+
if (/\.css$/.test(path)) {
|
|
1260
|
+
var _iterator3 = regeneratorValues._createForOfIteratorHelper(cssImportSpecifiersOf(code)),
|
|
1261
|
+
_step3;
|
|
1262
|
+
try {
|
|
1263
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
1264
|
+
var specifier = _step3.value;
|
|
1265
|
+
found.add(specifier);
|
|
1266
|
+
}
|
|
1267
|
+
} catch (err) {
|
|
1268
|
+
_iterator3.e(err);
|
|
1269
|
+
} finally {
|
|
1270
|
+
_iterator3.f();
|
|
1271
|
+
}
|
|
1272
|
+
continue;
|
|
1273
|
+
}
|
|
1226
1274
|
if (!/\.(tsx?|jsx?|mjs|cjs)$/.test(path)) continue;
|
|
1227
|
-
var
|
|
1228
|
-
|
|
1275
|
+
var _iterator4 = regeneratorValues._createForOfIteratorHelper(code.matchAll(/(?:from|import)\s*["']([^"'.][^"']*\.css)["']/g)),
|
|
1276
|
+
_step4;
|
|
1229
1277
|
try {
|
|
1230
|
-
for (
|
|
1231
|
-
var match =
|
|
1278
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
1279
|
+
var match = _step4.value;
|
|
1232
1280
|
found.add(match[1]);
|
|
1233
1281
|
}
|
|
1234
1282
|
} catch (err) {
|
|
1235
|
-
|
|
1283
|
+
_iterator4.e(err);
|
|
1236
1284
|
} finally {
|
|
1237
|
-
|
|
1285
|
+
_iterator4.f();
|
|
1238
1286
|
}
|
|
1239
1287
|
}
|
|
1240
1288
|
return regeneratorValues._toConsumableArray(found);
|
|
@@ -1259,19 +1307,19 @@ function importedSpecifiers(files) {
|
|
|
1259
1307
|
path = _Object$entries2$_i[0],
|
|
1260
1308
|
code = _Object$entries2$_i[1];
|
|
1261
1309
|
if (!/\.(tsx?|jsx?|mjs|cjs)$/.test(path)) continue;
|
|
1262
|
-
var
|
|
1263
|
-
|
|
1310
|
+
var _iterator5 = regeneratorValues._createForOfIteratorHelper(code.matchAll(IMPORT)),
|
|
1311
|
+
_step5;
|
|
1264
1312
|
try {
|
|
1265
|
-
for (
|
|
1313
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
1266
1314
|
var _match$;
|
|
1267
|
-
var match =
|
|
1315
|
+
var match = _step5.value;
|
|
1268
1316
|
var specifier = (_match$ = match[1]) !== null && _match$ !== void 0 ? _match$ : match[2];
|
|
1269
1317
|
if (specifier && !specifier.startsWith("#")) found.add(specifier);
|
|
1270
1318
|
}
|
|
1271
1319
|
} catch (err) {
|
|
1272
|
-
|
|
1320
|
+
_iterator5.e(err);
|
|
1273
1321
|
} finally {
|
|
1274
|
-
|
|
1322
|
+
_iterator5.f();
|
|
1275
1323
|
}
|
|
1276
1324
|
}
|
|
1277
1325
|
return found;
|
|
@@ -1303,11 +1351,11 @@ function layerDepsOf(manifest) {
|
|
|
1303
1351
|
// collectDependencyCss; building them as code entries fails, because a
|
|
1304
1352
|
// package like that may have no JS entry point at all.
|
|
1305
1353
|
var cssOnly = new Set();
|
|
1306
|
-
var
|
|
1307
|
-
|
|
1354
|
+
var _iterator6 = regeneratorValues._createForOfIteratorHelper(importedSpecifiers(files)),
|
|
1355
|
+
_step6;
|
|
1308
1356
|
try {
|
|
1309
|
-
for (
|
|
1310
|
-
var specifier =
|
|
1357
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
1358
|
+
var specifier = _step6.value;
|
|
1311
1359
|
var pkg = packageOf(specifier);
|
|
1312
1360
|
if (!declared.has(pkg) || BASE_PROVIDED.has(pkg)) continue;
|
|
1313
1361
|
if (specifier.endsWith(".css")) {
|
|
@@ -1316,31 +1364,52 @@ function layerDepsOf(manifest) {
|
|
|
1316
1364
|
}
|
|
1317
1365
|
specifiers.add(specifier);
|
|
1318
1366
|
}
|
|
1367
|
+
// A package a STYLESHEET imports -- a font, typically -- is a stylesheet
|
|
1368
|
+
// and its files, with no JS entry to build. Left in, it is built as code,
|
|
1369
|
+
// fails, and is reported as skipped on every publish.
|
|
1370
|
+
} catch (err) {
|
|
1371
|
+
_iterator6.e(err);
|
|
1372
|
+
} finally {
|
|
1373
|
+
_iterator6.f();
|
|
1374
|
+
}
|
|
1375
|
+
var _iterator7 = regeneratorValues._createForOfIteratorHelper(cssSpecifiersOf(files)),
|
|
1376
|
+
_step7;
|
|
1377
|
+
try {
|
|
1378
|
+
var _loop = function _loop() {
|
|
1379
|
+
var specifier = _step7.value;
|
|
1380
|
+
var pkg = packageOf(specifier);
|
|
1381
|
+
if (declared.has(pkg) && !regeneratorValues._toConsumableArray(specifiers).some(function (s) {
|
|
1382
|
+
return packageOf(s) === pkg;
|
|
1383
|
+
})) cssOnly.add(pkg);
|
|
1384
|
+
};
|
|
1385
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
1386
|
+
_loop();
|
|
1387
|
+
}
|
|
1319
1388
|
|
|
1320
1389
|
// A declared dependency nothing imports still gets an entry, so that a
|
|
1321
1390
|
// project can add one and import it from the studio without a CI round-trip.
|
|
1322
1391
|
} catch (err) {
|
|
1323
|
-
|
|
1392
|
+
_iterator7.e(err);
|
|
1324
1393
|
} finally {
|
|
1325
|
-
|
|
1394
|
+
_iterator7.f();
|
|
1326
1395
|
}
|
|
1327
|
-
var
|
|
1328
|
-
|
|
1396
|
+
var _iterator8 = regeneratorValues._createForOfIteratorHelper(declared),
|
|
1397
|
+
_step8;
|
|
1329
1398
|
try {
|
|
1330
|
-
var
|
|
1331
|
-
var name =
|
|
1399
|
+
var _loop2 = function _loop2() {
|
|
1400
|
+
var name = _step8.value;
|
|
1332
1401
|
if (cssOnly.has(name)) return 1; // continue
|
|
1333
1402
|
if (!regeneratorValues._toConsumableArray(specifiers).some(function (specifier) {
|
|
1334
1403
|
return packageOf(specifier) === name;
|
|
1335
1404
|
})) specifiers.add(name);
|
|
1336
1405
|
};
|
|
1337
|
-
for (
|
|
1338
|
-
if (
|
|
1406
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
1407
|
+
if (_loop2()) continue;
|
|
1339
1408
|
}
|
|
1340
1409
|
} catch (err) {
|
|
1341
|
-
|
|
1410
|
+
_iterator8.e(err);
|
|
1342
1411
|
} finally {
|
|
1343
|
-
|
|
1412
|
+
_iterator8.f();
|
|
1344
1413
|
}
|
|
1345
1414
|
return regeneratorValues._toConsumableArray(specifiers).sort();
|
|
1346
1415
|
}
|
|
@@ -1371,12 +1440,23 @@ var STUB_DIR = ".platform-vendor-stubs";
|
|
|
1371
1440
|
* into the project's stylesheet by the builder's CSS pass. Resolution is the
|
|
1372
1441
|
* project's own, so the version matches whatever its lockfile pinned.
|
|
1373
1442
|
*/
|
|
1374
|
-
function collectDependencyCss(_x22, _x23) {
|
|
1443
|
+
function collectDependencyCss(_x22, _x23, _x24) {
|
|
1375
1444
|
return _collectDependencyCss.apply(this, arguments);
|
|
1376
1445
|
}
|
|
1446
|
+
|
|
1447
|
+
/** `url(...)` with a relative target, quoted or not. */
|
|
1377
1448
|
function _collectDependencyCss() {
|
|
1378
|
-
_collectDependencyCss = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function _callee8(dir, specifiers
|
|
1379
|
-
|
|
1449
|
+
_collectDependencyCss = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function _callee8(dir, specifiers,
|
|
1450
|
+
/**
|
|
1451
|
+
* Where the files a stylesheet points at with `url(...)` go, base64, keyed
|
|
1452
|
+
* by the content-addressed name the rewritten `url()` now uses. Pass it to
|
|
1453
|
+
* the build as `dependencyAssets`, which publishes them under `/_app/a/`.
|
|
1454
|
+
*
|
|
1455
|
+
* Without it the stylesheets are carried as they are, and a relative `url()`
|
|
1456
|
+
* in one -- every font package's -- points at nothing once it is served.
|
|
1457
|
+
*/
|
|
1458
|
+
assets) {
|
|
1459
|
+
var require, css, _iterator15, _step15, specifier, file, _t0;
|
|
1380
1460
|
return regeneratorValues._regenerator().w(function (_context8) {
|
|
1381
1461
|
while (1) switch (_context8.p = _context8.n) {
|
|
1382
1462
|
case 0:
|
|
@@ -1388,66 +1468,211 @@ function _collectDependencyCss() {
|
|
|
1388
1468
|
case 1:
|
|
1389
1469
|
require = node_module.createRequire(node_path.join(node_path.resolve(dir), "package.json"));
|
|
1390
1470
|
css = {};
|
|
1391
|
-
|
|
1471
|
+
_iterator15 = regeneratorValues._createForOfIteratorHelper(specifiers);
|
|
1392
1472
|
_context8.p = 2;
|
|
1393
|
-
|
|
1473
|
+
_iterator15.s();
|
|
1394
1474
|
case 3:
|
|
1395
|
-
if ((
|
|
1396
|
-
_context8.n =
|
|
1475
|
+
if ((_step15 = _iterator15.n()).done) {
|
|
1476
|
+
_context8.n = 10;
|
|
1397
1477
|
break;
|
|
1398
1478
|
}
|
|
1399
|
-
specifier =
|
|
1479
|
+
specifier = _step15.value;
|
|
1480
|
+
file = void 0;
|
|
1400
1481
|
_context8.p = 4;
|
|
1401
|
-
|
|
1402
|
-
|
|
1482
|
+
file = require.resolve(specifier);
|
|
1483
|
+
_context8.n = 6;
|
|
1484
|
+
break;
|
|
1403
1485
|
case 5:
|
|
1486
|
+
_context8.p = 5;
|
|
1487
|
+
_context8.v;
|
|
1488
|
+
return _context8.a(3, 9);
|
|
1489
|
+
case 6:
|
|
1490
|
+
if (file.endsWith(".css")) {
|
|
1491
|
+
_context8.n = 7;
|
|
1492
|
+
break;
|
|
1493
|
+
}
|
|
1494
|
+
return _context8.a(3, 9);
|
|
1495
|
+
case 7:
|
|
1496
|
+
_context8.n = 8;
|
|
1497
|
+
return readDependencyStylesheet(file, assets, new Set());
|
|
1498
|
+
case 8:
|
|
1404
1499
|
css[specifier] = _context8.v;
|
|
1405
|
-
|
|
1500
|
+
case 9:
|
|
1501
|
+
_context8.n = 3;
|
|
1502
|
+
break;
|
|
1503
|
+
case 10:
|
|
1504
|
+
_context8.n = 12;
|
|
1406
1505
|
break;
|
|
1506
|
+
case 11:
|
|
1507
|
+
_context8.p = 11;
|
|
1508
|
+
_t0 = _context8.v;
|
|
1509
|
+
_iterator15.e(_t0);
|
|
1510
|
+
case 12:
|
|
1511
|
+
_context8.p = 12;
|
|
1512
|
+
_iterator15.f();
|
|
1513
|
+
return _context8.f(12);
|
|
1514
|
+
case 13:
|
|
1515
|
+
return _context8.a(2, css);
|
|
1516
|
+
}
|
|
1517
|
+
}, _callee8, null, [[4, 5], [2, 11, 12, 13]]);
|
|
1518
|
+
}));
|
|
1519
|
+
return _collectDependencyCss.apply(this, arguments);
|
|
1520
|
+
}
|
|
1521
|
+
var RELATIVE_URL = /url\(\s*(["']?)(?![a-z]+:|\/|#)([^"')]+)\1\s*\)/gi;
|
|
1522
|
+
|
|
1523
|
+
/**
|
|
1524
|
+
* A dependency's stylesheet, made self-contained.
|
|
1525
|
+
*
|
|
1526
|
+
* Its own relative `@import`s are inlined -- they point into the package, which
|
|
1527
|
+
* the browser build will never see -- and, given `assets`, every relative
|
|
1528
|
+
* `url()` is read, published as a content-addressed asset and pointed at it.
|
|
1529
|
+
* Names follow `resolveAsset`'s: the first 16 hex of the base64's SHA-256, and
|
|
1530
|
+
* the file's own extension.
|
|
1531
|
+
*/
|
|
1532
|
+
function readDependencyStylesheet(_x25, _x26, _x27) {
|
|
1533
|
+
return _readDependencyStylesheet.apply(this, arguments);
|
|
1534
|
+
}
|
|
1535
|
+
function _readDependencyStylesheet() {
|
|
1536
|
+
_readDependencyStylesheet = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function _callee9(file, assets, seen) {
|
|
1537
|
+
var base, css, imports, _iterator16, _step16, match, target, inlined, rewrites, _iterator17, _step17, _match, reference, path, base64, hash, name, _t1, _t10, _t12;
|
|
1538
|
+
return regeneratorValues._regenerator().w(function (_context9) {
|
|
1539
|
+
while (1) switch (_context9.p = _context9.n) {
|
|
1540
|
+
case 0:
|
|
1541
|
+
seen.add(file);
|
|
1542
|
+
base = node_path.dirname(file);
|
|
1543
|
+
_context9.n = 1;
|
|
1544
|
+
return promises.readFile(file, "utf8");
|
|
1545
|
+
case 1:
|
|
1546
|
+
css = _context9.v;
|
|
1547
|
+
imports = regeneratorValues._toConsumableArray(css.matchAll(/@import\s+(?:url\(\s*)?(["'])(\.{1,2}\/[^"']+)\1[^;]*;/g));
|
|
1548
|
+
_iterator16 = regeneratorValues._createForOfIteratorHelper(imports);
|
|
1549
|
+
_context9.p = 2;
|
|
1550
|
+
_iterator16.s();
|
|
1551
|
+
case 3:
|
|
1552
|
+
if ((_step16 = _iterator16.n()).done) {
|
|
1553
|
+
_context9.n = 8;
|
|
1554
|
+
break;
|
|
1555
|
+
}
|
|
1556
|
+
match = _step16.value;
|
|
1557
|
+
target = node_path.join(base, match[2]);
|
|
1558
|
+
if (!seen.has(target)) {
|
|
1559
|
+
_context9.n = 4;
|
|
1560
|
+
break;
|
|
1561
|
+
}
|
|
1562
|
+
_t1 = "";
|
|
1563
|
+
_context9.n = 6;
|
|
1564
|
+
break;
|
|
1565
|
+
case 4:
|
|
1566
|
+
_context9.n = 5;
|
|
1567
|
+
return readDependencyStylesheet(target, assets, seen)["catch"](function () {
|
|
1568
|
+
return null;
|
|
1569
|
+
});
|
|
1570
|
+
case 5:
|
|
1571
|
+
_t1 = _context9.v;
|
|
1407
1572
|
case 6:
|
|
1408
|
-
|
|
1409
|
-
|
|
1573
|
+
inlined = _t1;
|
|
1574
|
+
// A missing file stays an import, so the builder names it.
|
|
1575
|
+
if (inlined !== null) css = css.replace(match[0], inlined);
|
|
1410
1576
|
case 7:
|
|
1411
|
-
|
|
1577
|
+
_context9.n = 3;
|
|
1412
1578
|
break;
|
|
1413
1579
|
case 8:
|
|
1414
|
-
|
|
1580
|
+
_context9.n = 10;
|
|
1415
1581
|
break;
|
|
1416
1582
|
case 9:
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1583
|
+
_context9.p = 9;
|
|
1584
|
+
_t10 = _context9.v;
|
|
1585
|
+
_iterator16.e(_t10);
|
|
1420
1586
|
case 10:
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
return
|
|
1587
|
+
_context9.p = 10;
|
|
1588
|
+
_iterator16.f();
|
|
1589
|
+
return _context9.f(10);
|
|
1424
1590
|
case 11:
|
|
1425
|
-
|
|
1591
|
+
if (assets) {
|
|
1592
|
+
_context9.n = 12;
|
|
1593
|
+
break;
|
|
1594
|
+
}
|
|
1595
|
+
return _context9.a(2, css);
|
|
1596
|
+
case 12:
|
|
1597
|
+
rewrites = new Map();
|
|
1598
|
+
_iterator17 = regeneratorValues._createForOfIteratorHelper(css.matchAll(RELATIVE_URL));
|
|
1599
|
+
_context9.p = 13;
|
|
1600
|
+
_iterator17.s();
|
|
1601
|
+
case 14:
|
|
1602
|
+
if ((_step17 = _iterator17.n()).done) {
|
|
1603
|
+
_context9.n = 21;
|
|
1604
|
+
break;
|
|
1605
|
+
}
|
|
1606
|
+
_match = _step17.value;
|
|
1607
|
+
reference = _match[2].trim();
|
|
1608
|
+
if (!rewrites.has(reference)) {
|
|
1609
|
+
_context9.n = 15;
|
|
1610
|
+
break;
|
|
1611
|
+
}
|
|
1612
|
+
return _context9.a(3, 20);
|
|
1613
|
+
case 15:
|
|
1614
|
+
path = node_path.join(base, reference.split(/[?#]/)[0]);
|
|
1615
|
+
base64 = void 0;
|
|
1616
|
+
_context9.p = 16;
|
|
1617
|
+
_context9.n = 17;
|
|
1618
|
+
return promises.readFile(path);
|
|
1619
|
+
case 17:
|
|
1620
|
+
base64 = _context9.v.toString("base64");
|
|
1621
|
+
_context9.n = 19;
|
|
1622
|
+
break;
|
|
1623
|
+
case 18:
|
|
1624
|
+
_context9.p = 18;
|
|
1625
|
+
_context9.v;
|
|
1626
|
+
return _context9.a(3, 20);
|
|
1627
|
+
case 19:
|
|
1628
|
+
hash = node_crypto.createHash("sha256").update(base64).digest("hex").slice(0, 16);
|
|
1629
|
+
name = "".concat(hash).concat(node_path.extname(path).toLowerCase());
|
|
1630
|
+
assets[name] = base64;
|
|
1631
|
+
rewrites.set(reference, "".concat(regeneratorValues.ASSET_BASE).concat(name));
|
|
1632
|
+
case 20:
|
|
1633
|
+
_context9.n = 14;
|
|
1634
|
+
break;
|
|
1635
|
+
case 21:
|
|
1636
|
+
_context9.n = 23;
|
|
1637
|
+
break;
|
|
1638
|
+
case 22:
|
|
1639
|
+
_context9.p = 22;
|
|
1640
|
+
_t12 = _context9.v;
|
|
1641
|
+
_iterator17.e(_t12);
|
|
1642
|
+
case 23:
|
|
1643
|
+
_context9.p = 23;
|
|
1644
|
+
_iterator17.f();
|
|
1645
|
+
return _context9.f(23);
|
|
1646
|
+
case 24:
|
|
1647
|
+
return _context9.a(2, css.replace(RELATIVE_URL, function (whole, _quote, reference) {
|
|
1648
|
+
var url = rewrites.get(reference.trim());
|
|
1649
|
+
return url ? "url(".concat(url, ")") : whole;
|
|
1650
|
+
}));
|
|
1426
1651
|
}
|
|
1427
|
-
},
|
|
1652
|
+
}, _callee9, null, [[16, 18], [13, 22, 23, 24], [2, 9, 10, 11]]);
|
|
1428
1653
|
}));
|
|
1429
|
-
return
|
|
1654
|
+
return _readDependencyStylesheet.apply(this, arguments);
|
|
1430
1655
|
}
|
|
1431
|
-
function buildVendorLayer(
|
|
1656
|
+
function buildVendorLayer(_x28, _x29, _x30, _x31) {
|
|
1432
1657
|
return _buildVendorLayer.apply(this, arguments);
|
|
1433
1658
|
}
|
|
1434
1659
|
function _buildVendorLayer() {
|
|
1435
|
-
_buildVendorLayer = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function
|
|
1436
|
-
var modules,
|
|
1437
|
-
return regeneratorValues._regenerator().w(function (
|
|
1438
|
-
while (1) switch (
|
|
1660
|
+
_buildVendorLayer = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function _callee0(dir, deps, css, platform) {
|
|
1661
|
+
var modules, _iterator18, _step18, _loop3, stubs, input, _i3, _Object$entries3, _Object$entries3$_i, specifier, name, file, skipped, workerOnly, workerOnlyReasons, specifierOf, usable, built, _i4, _Object$values, _name2, worked, reasons, _iterator19, _step19, target, _message, _reasons$, _i5, _Object$entries4, _Object$entries4$_i, _specifier, _name3, _t13, _t14, _t15;
|
|
1662
|
+
return regeneratorValues._regenerator().w(function (_context1) {
|
|
1663
|
+
while (1) switch (_context1.p = _context1.n) {
|
|
1439
1664
|
case 0:
|
|
1440
1665
|
if (!(deps.length === 0 && Object.keys(css).length === 0)) {
|
|
1441
|
-
|
|
1666
|
+
_context1.n = 1;
|
|
1442
1667
|
break;
|
|
1443
1668
|
}
|
|
1444
|
-
return
|
|
1669
|
+
return _context1.a(2, null);
|
|
1445
1670
|
case 1:
|
|
1446
1671
|
if (!(deps.length === 0)) {
|
|
1447
|
-
|
|
1672
|
+
_context1.n = 2;
|
|
1448
1673
|
break;
|
|
1449
1674
|
}
|
|
1450
|
-
return
|
|
1675
|
+
return _context1.a(2, {
|
|
1451
1676
|
rev: cssRev(css),
|
|
1452
1677
|
modules: {},
|
|
1453
1678
|
worker: {},
|
|
@@ -1459,14 +1684,14 @@ function _buildVendorLayer() {
|
|
|
1459
1684
|
});
|
|
1460
1685
|
case 2:
|
|
1461
1686
|
modules = {};
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1687
|
+
_iterator18 = regeneratorValues._createForOfIteratorHelper(deps);
|
|
1688
|
+
_context1.p = 3;
|
|
1689
|
+
_loop3 = /*#__PURE__*/regeneratorValues._regenerator().m(function _loop3() {
|
|
1465
1690
|
var specifier, name, clash;
|
|
1466
|
-
return regeneratorValues._regenerator().w(function (
|
|
1467
|
-
while (1) switch (
|
|
1691
|
+
return regeneratorValues._regenerator().w(function (_context0) {
|
|
1692
|
+
while (1) switch (_context0.n) {
|
|
1468
1693
|
case 0:
|
|
1469
|
-
specifier =
|
|
1694
|
+
specifier = _step18.value;
|
|
1470
1695
|
name = chunkNameFor(specifier);
|
|
1471
1696
|
clash = Object.entries(modules).find(function (_ref4) {
|
|
1472
1697
|
var _ref5 = regeneratorValues._slicedToArray(_ref4, 2),
|
|
@@ -1474,38 +1699,38 @@ function _buildVendorLayer() {
|
|
|
1474
1699
|
return existing === name;
|
|
1475
1700
|
});
|
|
1476
1701
|
if (!clash) {
|
|
1477
|
-
|
|
1702
|
+
_context0.n = 1;
|
|
1478
1703
|
break;
|
|
1479
1704
|
}
|
|
1480
1705
|
throw new Error("'".concat(specifier, "' and '").concat(clash[0], "' both map to the chunk name '").concat(name, "'. ") + "Rename is not an option, so this needs chunkNameFor to disambiguate.");
|
|
1481
1706
|
case 1:
|
|
1482
1707
|
modules[specifier] = name;
|
|
1483
1708
|
case 2:
|
|
1484
|
-
return
|
|
1709
|
+
return _context0.a(2);
|
|
1485
1710
|
}
|
|
1486
|
-
},
|
|
1711
|
+
}, _loop3);
|
|
1487
1712
|
});
|
|
1488
|
-
|
|
1713
|
+
_iterator18.s();
|
|
1489
1714
|
case 4:
|
|
1490
|
-
if ((
|
|
1491
|
-
|
|
1715
|
+
if ((_step18 = _iterator18.n()).done) {
|
|
1716
|
+
_context1.n = 6;
|
|
1492
1717
|
break;
|
|
1493
1718
|
}
|
|
1494
|
-
return
|
|
1719
|
+
return _context1.d(regeneratorValues._regeneratorValues(_loop3()), 5);
|
|
1495
1720
|
case 5:
|
|
1496
|
-
|
|
1721
|
+
_context1.n = 4;
|
|
1497
1722
|
break;
|
|
1498
1723
|
case 6:
|
|
1499
|
-
|
|
1724
|
+
_context1.n = 8;
|
|
1500
1725
|
break;
|
|
1501
1726
|
case 7:
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1727
|
+
_context1.p = 7;
|
|
1728
|
+
_t13 = _context1.v;
|
|
1729
|
+
_iterator18.e(_t13);
|
|
1505
1730
|
case 8:
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
return
|
|
1731
|
+
_context1.p = 8;
|
|
1732
|
+
_iterator18.f();
|
|
1733
|
+
return _context1.f(8);
|
|
1509
1734
|
case 9:
|
|
1510
1735
|
// `resolve` rather than `join`, and the CLI's own default argument is why.
|
|
1511
1736
|
//
|
|
@@ -1522,34 +1747,34 @@ function _buildVendorLayer() {
|
|
|
1522
1747
|
// path: the suites all build in a mkdtemp. The one caller that does not is
|
|
1523
1748
|
// the one a person uses.
|
|
1524
1749
|
stubs = node_path.join(node_path.resolve(dir), STUB_DIR);
|
|
1525
|
-
|
|
1750
|
+
_context1.n = 10;
|
|
1526
1751
|
return promises.rm(stubs, {
|
|
1527
1752
|
recursive: true,
|
|
1528
1753
|
force: true
|
|
1529
1754
|
});
|
|
1530
1755
|
case 10:
|
|
1531
|
-
|
|
1756
|
+
_context1.n = 11;
|
|
1532
1757
|
return promises.mkdir(stubs, {
|
|
1533
1758
|
recursive: true
|
|
1534
1759
|
});
|
|
1535
1760
|
case 11:
|
|
1536
|
-
|
|
1761
|
+
_context1.p = 11;
|
|
1537
1762
|
input = {};
|
|
1538
1763
|
_i3 = 0, _Object$entries3 = Object.entries(modules);
|
|
1539
1764
|
case 12:
|
|
1540
1765
|
if (!(_i3 < _Object$entries3.length)) {
|
|
1541
|
-
|
|
1766
|
+
_context1.n = 15;
|
|
1542
1767
|
break;
|
|
1543
1768
|
}
|
|
1544
1769
|
_Object$entries3$_i = regeneratorValues._slicedToArray(_Object$entries3[_i3], 2), specifier = _Object$entries3$_i[0], name = _Object$entries3$_i[1];
|
|
1545
1770
|
file = node_path.join(stubs, "".concat(name, ".js"));
|
|
1546
|
-
|
|
1771
|
+
_context1.n = 13;
|
|
1547
1772
|
return promises.writeFile(file, stubSource(specifier));
|
|
1548
1773
|
case 13:
|
|
1549
1774
|
input[name] = file;
|
|
1550
1775
|
case 14:
|
|
1551
1776
|
_i3++;
|
|
1552
|
-
|
|
1777
|
+
_context1.n = 12;
|
|
1553
1778
|
break;
|
|
1554
1779
|
case 15:
|
|
1555
1780
|
// Fast path: one build with every entry, so shared code is shared. When it
|
|
@@ -1569,21 +1794,21 @@ function _buildVendorLayer() {
|
|
|
1569
1794
|
})[0];
|
|
1570
1795
|
};
|
|
1571
1796
|
usable = Object.values(modules);
|
|
1572
|
-
|
|
1797
|
+
_context1.n = 16;
|
|
1573
1798
|
return buildTargets(usable, input, node_path.join(stubs, "out"), false, platform)["catch"](function () {
|
|
1574
1799
|
return null;
|
|
1575
1800
|
});
|
|
1576
1801
|
case 16:
|
|
1577
|
-
built =
|
|
1802
|
+
built = _context1.v;
|
|
1578
1803
|
if (built) {
|
|
1579
|
-
|
|
1804
|
+
_context1.n = 32;
|
|
1580
1805
|
break;
|
|
1581
1806
|
}
|
|
1582
1807
|
usable = [];
|
|
1583
1808
|
_i4 = 0, _Object$values = Object.values(modules);
|
|
1584
1809
|
case 17:
|
|
1585
1810
|
if (!(_i4 < _Object$values.length)) {
|
|
1586
|
-
|
|
1811
|
+
_context1.n = 29;
|
|
1587
1812
|
break;
|
|
1588
1813
|
}
|
|
1589
1814
|
_name2 = _Object$values[_i4];
|
|
@@ -1597,44 +1822,44 @@ function _buildVendorLayer() {
|
|
|
1597
1822
|
// the builder, naming it.
|
|
1598
1823
|
worked = {};
|
|
1599
1824
|
reasons = [];
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1825
|
+
_iterator19 = regeneratorValues._createForOfIteratorHelper(targetsFor(platform));
|
|
1826
|
+
_context1.p = 18;
|
|
1827
|
+
_iterator19.s();
|
|
1603
1828
|
case 19:
|
|
1604
|
-
if ((
|
|
1605
|
-
|
|
1829
|
+
if ((_step19 = _iterator19.n()).done) {
|
|
1830
|
+
_context1.n = 24;
|
|
1606
1831
|
break;
|
|
1607
1832
|
}
|
|
1608
|
-
target =
|
|
1609
|
-
|
|
1610
|
-
|
|
1833
|
+
target = _step19.value;
|
|
1834
|
+
_context1.p = 20;
|
|
1835
|
+
_context1.n = 21;
|
|
1611
1836
|
return buildTargets({
|
|
1612
1837
|
worker: target.name === "worker" ? [_name2] : [],
|
|
1613
1838
|
browser: target.name === "browser" ? [_name2] : []
|
|
1614
1839
|
}, input, node_path.join(stubs, "probe", target.name, _name2), true, platform);
|
|
1615
1840
|
case 21:
|
|
1616
1841
|
worked[target.name] = true;
|
|
1617
|
-
|
|
1842
|
+
_context1.n = 23;
|
|
1618
1843
|
break;
|
|
1619
1844
|
case 22:
|
|
1620
|
-
|
|
1621
|
-
|
|
1845
|
+
_context1.p = 22;
|
|
1846
|
+
_t14 = _context1.v;
|
|
1622
1847
|
worked[target.name] = false;
|
|
1623
|
-
reasons.push(firstLine(String((_message =
|
|
1848
|
+
reasons.push(firstLine(String((_message = _t14 === null || _t14 === void 0 ? void 0 : _t14.message) !== null && _message !== void 0 ? _message : _t14)));
|
|
1624
1849
|
case 23:
|
|
1625
|
-
|
|
1850
|
+
_context1.n = 19;
|
|
1626
1851
|
break;
|
|
1627
1852
|
case 24:
|
|
1628
|
-
|
|
1853
|
+
_context1.n = 26;
|
|
1629
1854
|
break;
|
|
1630
1855
|
case 25:
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1856
|
+
_context1.p = 25;
|
|
1857
|
+
_t15 = _context1.v;
|
|
1858
|
+
_iterator19.e(_t15);
|
|
1634
1859
|
case 26:
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
return
|
|
1860
|
+
_context1.p = 26;
|
|
1861
|
+
_iterator19.f();
|
|
1862
|
+
return _context1.f(26);
|
|
1638
1863
|
case 27:
|
|
1639
1864
|
if (worked.worker && worked.browser) usable.push(_name2);else if (worked.worker) {
|
|
1640
1865
|
usable.push(_name2);
|
|
@@ -1654,7 +1879,7 @@ function _buildVendorLayer() {
|
|
|
1654
1879
|
}
|
|
1655
1880
|
case 28:
|
|
1656
1881
|
_i4++;
|
|
1657
|
-
|
|
1882
|
+
_context1.n = 17;
|
|
1658
1883
|
break;
|
|
1659
1884
|
case 29:
|
|
1660
1885
|
for (_i5 = 0, _Object$entries4 = Object.entries(modules); _i5 < _Object$entries4.length; _i5++) {
|
|
@@ -1664,10 +1889,10 @@ function _buildVendorLayer() {
|
|
|
1664
1889
|
// Everything failed: a layer with no entries is the same as no layer, and
|
|
1665
1890
|
// the skip list is what the caller reports.
|
|
1666
1891
|
if (!(usable.length === 0)) {
|
|
1667
|
-
|
|
1892
|
+
_context1.n = 30;
|
|
1668
1893
|
break;
|
|
1669
1894
|
}
|
|
1670
|
-
return
|
|
1895
|
+
return _context1.a(2, {
|
|
1671
1896
|
rev: "none",
|
|
1672
1897
|
modules: {},
|
|
1673
1898
|
worker: {},
|
|
@@ -1678,7 +1903,7 @@ function _buildVendorLayer() {
|
|
|
1678
1903
|
workerOnlyReasons: workerOnlyReasons
|
|
1679
1904
|
});
|
|
1680
1905
|
case 30:
|
|
1681
|
-
|
|
1906
|
+
_context1.n = 31;
|
|
1682
1907
|
return buildTargets({
|
|
1683
1908
|
worker: usable,
|
|
1684
1909
|
browser: usable.filter(function (name) {
|
|
@@ -1686,9 +1911,9 @@ function _buildVendorLayer() {
|
|
|
1686
1911
|
})
|
|
1687
1912
|
}, input, node_path.join(stubs, "out"), false, platform);
|
|
1688
1913
|
case 31:
|
|
1689
|
-
built =
|
|
1914
|
+
built = _context1.v;
|
|
1690
1915
|
case 32:
|
|
1691
|
-
return
|
|
1916
|
+
return _context1.a(2, {
|
|
1692
1917
|
rev: "".concat(built.rev).concat(cssRev(css) ? "-".concat(cssRev(css)) : ""),
|
|
1693
1918
|
modules: modules,
|
|
1694
1919
|
worker: built.worker,
|
|
@@ -1699,18 +1924,18 @@ function _buildVendorLayer() {
|
|
|
1699
1924
|
workerOnlyReasons: workerOnlyReasons
|
|
1700
1925
|
});
|
|
1701
1926
|
case 33:
|
|
1702
|
-
|
|
1703
|
-
|
|
1927
|
+
_context1.p = 33;
|
|
1928
|
+
_context1.n = 34;
|
|
1704
1929
|
return promises.rm(stubs, {
|
|
1705
1930
|
recursive: true,
|
|
1706
1931
|
force: true
|
|
1707
1932
|
});
|
|
1708
1933
|
case 34:
|
|
1709
|
-
return
|
|
1934
|
+
return _context1.f(33);
|
|
1710
1935
|
case 35:
|
|
1711
|
-
return
|
|
1936
|
+
return _context1.a(2);
|
|
1712
1937
|
}
|
|
1713
|
-
},
|
|
1938
|
+
}, _callee0, null, [[20, 22], [18, 25, 26, 27], [11,, 33, 35], [3, 7, 8, 9]]);
|
|
1714
1939
|
}));
|
|
1715
1940
|
return _buildVendorLayer.apply(this, arguments);
|
|
1716
1941
|
}
|