@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
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as _asyncToGenerator, b as _regenerator, c as _toConsumableArray, f as _objectSpread2, _ as _createForOfIteratorHelper, d as _slicedToArray, e as _regeneratorValues } from '../../dist/regeneratorValues-
|
|
1
|
+
import { a as _asyncToGenerator, b as _regenerator, c as _toConsumableArray, f as _objectSpread2, _ as _createForOfIteratorHelper, d as _slicedToArray, A as ASSET_BASE, e as _regeneratorValues } from '../../dist/regeneratorValues-af449040.esm.js';
|
|
2
2
|
import { build } from 'rolldown';
|
|
3
3
|
import { createHash } from 'node:crypto';
|
|
4
4
|
import { createRequire } from 'node:module';
|
|
5
5
|
import { readFile, rm, writeFile, mkdir, readdir, stat } from 'node:fs/promises';
|
|
6
|
-
import { join, resolve, dirname } from 'node:path';
|
|
6
|
+
import { join, resolve, extname, dirname } from 'node:path';
|
|
7
7
|
import { parseAstAsync } from 'rolldown/parseAst';
|
|
8
8
|
import { pathToFileURL } from 'node:url';
|
|
9
9
|
import { a as ENTRY_SHIM } from '../../dist/projectPaths-5e4defea.esm.js';
|
|
@@ -428,7 +428,7 @@ function buildTargets(_x, _x2, _x3, _x4, _x5) {
|
|
|
428
428
|
*/
|
|
429
429
|
function _buildTargets() {
|
|
430
430
|
_buildTargets = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(names, input, outRoot, quiet, platform) {
|
|
431
|
-
var out, digest,
|
|
431
|
+
var out, digest, _iterator9, _step9, target, forTarget, dir, shims, _iterator0, _step0, file, code, _t, _t2, _t3;
|
|
432
432
|
return _regenerator().w(function (_context2) {
|
|
433
433
|
while (1) switch (_context2.p = _context2.n) {
|
|
434
434
|
case 0:
|
|
@@ -437,15 +437,15 @@ function _buildTargets() {
|
|
|
437
437
|
browser: {}
|
|
438
438
|
};
|
|
439
439
|
digest = createHash("sha256");
|
|
440
|
-
|
|
440
|
+
_iterator9 = _createForOfIteratorHelper(targetsFor(platform));
|
|
441
441
|
_context2.p = 1;
|
|
442
|
-
|
|
442
|
+
_iterator9.s();
|
|
443
443
|
case 2:
|
|
444
|
-
if ((
|
|
444
|
+
if ((_step9 = _iterator9.n()).done) {
|
|
445
445
|
_context2.n = 17;
|
|
446
446
|
break;
|
|
447
447
|
}
|
|
448
|
-
target =
|
|
448
|
+
target = _step9.value;
|
|
449
449
|
forTarget = Array.isArray(names) ? names : names[target.name]; // Nothing for this side: a dependency can be server-only, and building an
|
|
450
450
|
// empty bundle is both pointless and an error.
|
|
451
451
|
if (!(forTarget.length === 0)) {
|
|
@@ -575,15 +575,15 @@ function _buildTargets() {
|
|
|
575
575
|
_context2.n = 7;
|
|
576
576
|
return readdir(dir);
|
|
577
577
|
case 7:
|
|
578
|
-
|
|
578
|
+
_iterator0 = _t(_context2.v.sort());
|
|
579
579
|
_context2.p = 8;
|
|
580
|
-
|
|
580
|
+
_iterator0.s();
|
|
581
581
|
case 9:
|
|
582
|
-
if ((
|
|
582
|
+
if ((_step0 = _iterator0.n()).done) {
|
|
583
583
|
_context2.n = 13;
|
|
584
584
|
break;
|
|
585
585
|
}
|
|
586
|
-
file =
|
|
586
|
+
file = _step0.value;
|
|
587
587
|
_context2.n = 10;
|
|
588
588
|
return readFile(join(dir, file), "utf8");
|
|
589
589
|
case 10:
|
|
@@ -605,10 +605,10 @@ function _buildTargets() {
|
|
|
605
605
|
case 14:
|
|
606
606
|
_context2.p = 14;
|
|
607
607
|
_t2 = _context2.v;
|
|
608
|
-
|
|
608
|
+
_iterator0.e(_t2);
|
|
609
609
|
case 15:
|
|
610
610
|
_context2.p = 15;
|
|
611
|
-
|
|
611
|
+
_iterator0.f();
|
|
612
612
|
return _context2.f(15);
|
|
613
613
|
case 16:
|
|
614
614
|
_context2.n = 2;
|
|
@@ -619,10 +619,10 @@ function _buildTargets() {
|
|
|
619
619
|
case 18:
|
|
620
620
|
_context2.p = 18;
|
|
621
621
|
_t3 = _context2.v;
|
|
622
|
-
|
|
622
|
+
_iterator9.e(_t3);
|
|
623
623
|
case 19:
|
|
624
624
|
_context2.p = 19;
|
|
625
|
-
|
|
625
|
+
_iterator9.f();
|
|
626
626
|
return _context2.f(19);
|
|
627
627
|
case 20:
|
|
628
628
|
return _context2.a(2, _objectSpread2(_objectSpread2({}, out), {}, {
|
|
@@ -854,7 +854,7 @@ function auditableImports(_x8, _x9) {
|
|
|
854
854
|
}
|
|
855
855
|
function _auditableImports() {
|
|
856
856
|
_auditableImports = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(code, file) {
|
|
857
|
-
var ast, imports,
|
|
857
|
+
var ast, imports, _iterator1, _step1, _statement$source, _statement$specifiers, statement, source, names, _iterator10, _step10, specifier, name, _name, _t4;
|
|
858
858
|
return _regenerator().w(function (_context3) {
|
|
859
859
|
while (1) switch (_context3.p = _context3.n) {
|
|
860
860
|
case 0:
|
|
@@ -863,15 +863,15 @@ function _auditableImports() {
|
|
|
863
863
|
case 1:
|
|
864
864
|
ast = _context3.v;
|
|
865
865
|
imports = [];
|
|
866
|
-
|
|
866
|
+
_iterator1 = _createForOfIteratorHelper(ast.body);
|
|
867
867
|
_context3.p = 2;
|
|
868
|
-
|
|
868
|
+
_iterator1.s();
|
|
869
869
|
case 3:
|
|
870
|
-
if ((
|
|
870
|
+
if ((_step1 = _iterator1.n()).done) {
|
|
871
871
|
_context3.n = 7;
|
|
872
872
|
break;
|
|
873
873
|
}
|
|
874
|
-
statement =
|
|
874
|
+
statement = _step1.value;
|
|
875
875
|
if (!(statement.type !== "ImportDeclaration" && statement.type !== "ExportNamedDeclaration" && statement.type !== "ExportAllDeclaration")) {
|
|
876
876
|
_context3.n = 4;
|
|
877
877
|
break;
|
|
@@ -886,10 +886,10 @@ function _auditableImports() {
|
|
|
886
886
|
return _context3.a(3, 6);
|
|
887
887
|
case 5:
|
|
888
888
|
names = [];
|
|
889
|
-
|
|
889
|
+
_iterator10 = _createForOfIteratorHelper((_statement$specifiers = statement.specifiers) !== null && _statement$specifiers !== void 0 ? _statement$specifiers : []);
|
|
890
890
|
try {
|
|
891
|
-
for (
|
|
892
|
-
specifier =
|
|
891
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
892
|
+
specifier = _step10.value;
|
|
893
893
|
if (specifier.type === "ImportDefaultSpecifier") names.push("default");else if (specifier.type === "ImportSpecifier") {
|
|
894
894
|
name = nameOf(specifier.imported);
|
|
895
895
|
if (name) names.push(name);
|
|
@@ -902,9 +902,9 @@ function _auditableImports() {
|
|
|
902
902
|
// whatever is there.
|
|
903
903
|
}
|
|
904
904
|
} catch (err) {
|
|
905
|
-
|
|
905
|
+
_iterator10.e(err);
|
|
906
906
|
} finally {
|
|
907
|
-
|
|
907
|
+
_iterator10.f();
|
|
908
908
|
}
|
|
909
909
|
imports.push({
|
|
910
910
|
source: source,
|
|
@@ -919,10 +919,10 @@ function _auditableImports() {
|
|
|
919
919
|
case 8:
|
|
920
920
|
_context3.p = 8;
|
|
921
921
|
_t4 = _context3.v;
|
|
922
|
-
|
|
922
|
+
_iterator1.e(_t4);
|
|
923
923
|
case 9:
|
|
924
924
|
_context3.p = 9;
|
|
925
|
-
|
|
925
|
+
_iterator1.f();
|
|
926
926
|
return _context3.f(9);
|
|
927
927
|
case 10:
|
|
928
928
|
return _context3.a(2, imports);
|
|
@@ -964,7 +964,7 @@ function baseChunkExports(_x10, _x11, _x12) {
|
|
|
964
964
|
}
|
|
965
965
|
function _baseChunkExports() {
|
|
966
966
|
_baseChunkExports = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(target, specifier, platform) {
|
|
967
|
-
var dist, file, code, ast, exported,
|
|
967
|
+
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;
|
|
968
968
|
return _regenerator().w(function (_context5) {
|
|
969
969
|
while (1) switch (_context5.p = _context5.n) {
|
|
970
970
|
case 0:
|
|
@@ -993,15 +993,15 @@ function _baseChunkExports() {
|
|
|
993
993
|
case 6:
|
|
994
994
|
ast = _context5.v;
|
|
995
995
|
exported = new Set();
|
|
996
|
-
|
|
996
|
+
_iterator11 = _createForOfIteratorHelper(ast.body);
|
|
997
997
|
_context5.p = 7;
|
|
998
|
-
|
|
998
|
+
_iterator11.s();
|
|
999
999
|
case 8:
|
|
1000
|
-
if ((
|
|
1000
|
+
if ((_step11 = _iterator11.n()).done) {
|
|
1001
1001
|
_context5.n = 13;
|
|
1002
1002
|
break;
|
|
1003
1003
|
}
|
|
1004
|
-
statement =
|
|
1004
|
+
statement = _step11.value;
|
|
1005
1005
|
if (!(statement.type === "ExportAllDeclaration")) {
|
|
1006
1006
|
_context5.n = 9;
|
|
1007
1007
|
break;
|
|
@@ -1021,34 +1021,34 @@ function _baseChunkExports() {
|
|
|
1021
1021
|
}
|
|
1022
1022
|
return _context5.a(3, 12);
|
|
1023
1023
|
case 11:
|
|
1024
|
-
|
|
1024
|
+
_iterator12 = _createForOfIteratorHelper((_statement$specifiers2 = statement.specifiers) !== null && _statement$specifiers2 !== void 0 ? _statement$specifiers2 : []);
|
|
1025
1025
|
try {
|
|
1026
|
-
for (
|
|
1027
|
-
specifierNode =
|
|
1026
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
1027
|
+
specifierNode = _step12.value;
|
|
1028
1028
|
name = nameOf(specifierNode.exported);
|
|
1029
1029
|
if (name) exported.add(name);
|
|
1030
1030
|
}
|
|
1031
1031
|
// `export const x = ...` / `export function x() {}`, which a hand-written
|
|
1032
1032
|
// chunk can carry even though a bundled one usually does not.
|
|
1033
1033
|
} catch (err) {
|
|
1034
|
-
|
|
1034
|
+
_iterator12.e(err);
|
|
1035
1035
|
} finally {
|
|
1036
|
-
|
|
1036
|
+
_iterator12.f();
|
|
1037
1037
|
}
|
|
1038
1038
|
declaration = statement.declaration;
|
|
1039
1039
|
if (declaration !== null && declaration !== void 0 && (_declaration$id = declaration.id) !== null && _declaration$id !== void 0 && _declaration$id.name) exported.add(declaration.id.name);
|
|
1040
|
-
|
|
1040
|
+
_iterator13 = _createForOfIteratorHelper((_declaration$declarat = declaration === null || declaration === void 0 ? void 0 : declaration.declarations) !== null && _declaration$declarat !== void 0 ? _declaration$declarat : []);
|
|
1041
1041
|
try {
|
|
1042
|
-
for (
|
|
1043
|
-
declarator =
|
|
1042
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
1043
|
+
declarator = _step13.value;
|
|
1044
1044
|
if (((_declarator$id = declarator.id) === null || _declarator$id === void 0 ? void 0 : _declarator$id.type) === "Identifier" && declarator.id.name) {
|
|
1045
1045
|
exported.add(declarator.id.name);
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
1048
|
} catch (err) {
|
|
1049
|
-
|
|
1049
|
+
_iterator13.e(err);
|
|
1050
1050
|
} finally {
|
|
1051
|
-
|
|
1051
|
+
_iterator13.f();
|
|
1052
1052
|
}
|
|
1053
1053
|
case 12:
|
|
1054
1054
|
_context5.n = 8;
|
|
@@ -1059,10 +1059,10 @@ function _baseChunkExports() {
|
|
|
1059
1059
|
case 14:
|
|
1060
1060
|
_context5.p = 14;
|
|
1061
1061
|
_t6 = _context5.v;
|
|
1062
|
-
|
|
1062
|
+
_iterator11.e(_t6);
|
|
1063
1063
|
case 15:
|
|
1064
1064
|
_context5.p = 15;
|
|
1065
|
-
|
|
1065
|
+
_iterator11.f();
|
|
1066
1066
|
return _context5.f(15);
|
|
1067
1067
|
case 16:
|
|
1068
1068
|
return _context5.a(2, exported);
|
|
@@ -1102,7 +1102,7 @@ function auditImports(_x13, _x14, _x15, _x16) {
|
|
|
1102
1102
|
*/
|
|
1103
1103
|
function _auditImports() {
|
|
1104
1104
|
_auditImports = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(target, file, code, platform) {
|
|
1105
|
-
var
|
|
1105
|
+
var _iterator14, _step14, _step14$value, specifier, names, intoBase, intoSelf, builtin, _t7, _t8;
|
|
1106
1106
|
return _regenerator().w(function (_context6) {
|
|
1107
1107
|
while (1) switch (_context6.p = _context6.n) {
|
|
1108
1108
|
case 0:
|
|
@@ -1110,15 +1110,15 @@ function _auditImports() {
|
|
|
1110
1110
|
_context6.n = 1;
|
|
1111
1111
|
return auditableImports(code, file);
|
|
1112
1112
|
case 1:
|
|
1113
|
-
|
|
1113
|
+
_iterator14 = _t7(_context6.v);
|
|
1114
1114
|
_context6.p = 2;
|
|
1115
|
-
|
|
1115
|
+
_iterator14.s();
|
|
1116
1116
|
case 3:
|
|
1117
|
-
if ((
|
|
1117
|
+
if ((_step14 = _iterator14.n()).done) {
|
|
1118
1118
|
_context6.n = 6;
|
|
1119
1119
|
break;
|
|
1120
1120
|
}
|
|
1121
|
-
|
|
1121
|
+
_step14$value = _step14.value, specifier = _step14$value.source, names = _step14$value.names;
|
|
1122
1122
|
intoBase = specifier.startsWith(target.baseFrom);
|
|
1123
1123
|
intoSelf = specifier.startsWith("./") || specifier.startsWith("../pvendor/"); // Only the worker target: a browser has no Node builtins, and a chunk that
|
|
1124
1124
|
// reached for one there is a genuine error rather than a runtime import.
|
|
@@ -1144,10 +1144,10 @@ function _auditImports() {
|
|
|
1144
1144
|
case 7:
|
|
1145
1145
|
_context6.p = 7;
|
|
1146
1146
|
_t8 = _context6.v;
|
|
1147
|
-
|
|
1147
|
+
_iterator14.e(_t8);
|
|
1148
1148
|
case 8:
|
|
1149
1149
|
_context6.p = 8;
|
|
1150
|
-
|
|
1150
|
+
_iterator14.f();
|
|
1151
1151
|
return _context6.f(8);
|
|
1152
1152
|
case 9:
|
|
1153
1153
|
return _context6.a(2);
|
|
@@ -1159,7 +1159,14 @@ function _auditImports() {
|
|
|
1159
1159
|
function auditBaseExports(_x17, _x18, _x19, _x20, _x21) {
|
|
1160
1160
|
return _auditBaseExports.apply(this, arguments);
|
|
1161
1161
|
}
|
|
1162
|
-
/**
|
|
1162
|
+
/**
|
|
1163
|
+
* A stylesheet's bare `@import`s -- `@import "@fontsource-variable/inter";` --
|
|
1164
|
+
* which name a package's stylesheet whether or not they end in `.css`.
|
|
1165
|
+
*
|
|
1166
|
+
* Not `tailwindcss`, which Tailwind resolves from its own inlined sheets, and
|
|
1167
|
+
* not a URL. Comments are stripped first, so an `@import` in a comment does not
|
|
1168
|
+
* pull a package in.
|
|
1169
|
+
*/
|
|
1163
1170
|
function _auditBaseExports() {
|
|
1164
1171
|
_auditBaseExports = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(target, file, specifier, names, platform) {
|
|
1165
1172
|
var exported, missing;
|
|
@@ -1195,24 +1202,65 @@ function _auditBaseExports() {
|
|
|
1195
1202
|
}));
|
|
1196
1203
|
return _auditBaseExports.apply(this, arguments);
|
|
1197
1204
|
}
|
|
1205
|
+
function cssImportSpecifiersOf(css) {
|
|
1206
|
+
var found = [];
|
|
1207
|
+
var code = css.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
1208
|
+
var _iterator2 = _createForOfIteratorHelper(code.matchAll(/@import\s+(?:url\(\s*)?(["'])([^"']+)\1/g)),
|
|
1209
|
+
_step2;
|
|
1210
|
+
try {
|
|
1211
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
1212
|
+
var match = _step2.value;
|
|
1213
|
+
var specifier = match[2];
|
|
1214
|
+
if (/^[./]/.test(specifier)) continue;
|
|
1215
|
+
if (/^tailwindcss(\/|$)/.test(specifier)) continue;
|
|
1216
|
+
if (/^([a-z]+:)?\/\//i.test(specifier)) continue;
|
|
1217
|
+
found.push(specifier);
|
|
1218
|
+
}
|
|
1219
|
+
} catch (err) {
|
|
1220
|
+
_iterator2.e(err);
|
|
1221
|
+
} finally {
|
|
1222
|
+
_iterator2.f();
|
|
1223
|
+
}
|
|
1224
|
+
return found;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* Bare specifiers that point at a stylesheet rather than a module: a `.css`
|
|
1229
|
+
* file a module imports, or anything a stylesheet `@import`s.
|
|
1230
|
+
*/
|
|
1198
1231
|
function cssSpecifiersOf(files) {
|
|
1199
1232
|
var found = new Set();
|
|
1200
1233
|
for (var _i = 0, _Object$entries = Object.entries(files); _i < _Object$entries.length; _i++) {
|
|
1201
1234
|
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
1202
1235
|
path = _Object$entries$_i[0],
|
|
1203
1236
|
code = _Object$entries$_i[1];
|
|
1237
|
+
if (/\.css$/.test(path)) {
|
|
1238
|
+
var _iterator3 = _createForOfIteratorHelper(cssImportSpecifiersOf(code)),
|
|
1239
|
+
_step3;
|
|
1240
|
+
try {
|
|
1241
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
1242
|
+
var specifier = _step3.value;
|
|
1243
|
+
found.add(specifier);
|
|
1244
|
+
}
|
|
1245
|
+
} catch (err) {
|
|
1246
|
+
_iterator3.e(err);
|
|
1247
|
+
} finally {
|
|
1248
|
+
_iterator3.f();
|
|
1249
|
+
}
|
|
1250
|
+
continue;
|
|
1251
|
+
}
|
|
1204
1252
|
if (!/\.(tsx?|jsx?|mjs|cjs)$/.test(path)) continue;
|
|
1205
|
-
var
|
|
1206
|
-
|
|
1253
|
+
var _iterator4 = _createForOfIteratorHelper(code.matchAll(/(?:from|import)\s*["']([^"'.][^"']*\.css)["']/g)),
|
|
1254
|
+
_step4;
|
|
1207
1255
|
try {
|
|
1208
|
-
for (
|
|
1209
|
-
var match =
|
|
1256
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
1257
|
+
var match = _step4.value;
|
|
1210
1258
|
found.add(match[1]);
|
|
1211
1259
|
}
|
|
1212
1260
|
} catch (err) {
|
|
1213
|
-
|
|
1261
|
+
_iterator4.e(err);
|
|
1214
1262
|
} finally {
|
|
1215
|
-
|
|
1263
|
+
_iterator4.f();
|
|
1216
1264
|
}
|
|
1217
1265
|
}
|
|
1218
1266
|
return _toConsumableArray(found);
|
|
@@ -1237,19 +1285,19 @@ function importedSpecifiers(files) {
|
|
|
1237
1285
|
path = _Object$entries2$_i[0],
|
|
1238
1286
|
code = _Object$entries2$_i[1];
|
|
1239
1287
|
if (!/\.(tsx?|jsx?|mjs|cjs)$/.test(path)) continue;
|
|
1240
|
-
var
|
|
1241
|
-
|
|
1288
|
+
var _iterator5 = _createForOfIteratorHelper(code.matchAll(IMPORT)),
|
|
1289
|
+
_step5;
|
|
1242
1290
|
try {
|
|
1243
|
-
for (
|
|
1291
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
1244
1292
|
var _match$;
|
|
1245
|
-
var match =
|
|
1293
|
+
var match = _step5.value;
|
|
1246
1294
|
var specifier = (_match$ = match[1]) !== null && _match$ !== void 0 ? _match$ : match[2];
|
|
1247
1295
|
if (specifier && !specifier.startsWith("#")) found.add(specifier);
|
|
1248
1296
|
}
|
|
1249
1297
|
} catch (err) {
|
|
1250
|
-
|
|
1298
|
+
_iterator5.e(err);
|
|
1251
1299
|
} finally {
|
|
1252
|
-
|
|
1300
|
+
_iterator5.f();
|
|
1253
1301
|
}
|
|
1254
1302
|
}
|
|
1255
1303
|
return found;
|
|
@@ -1281,11 +1329,11 @@ function layerDepsOf(manifest) {
|
|
|
1281
1329
|
// collectDependencyCss; building them as code entries fails, because a
|
|
1282
1330
|
// package like that may have no JS entry point at all.
|
|
1283
1331
|
var cssOnly = new Set();
|
|
1284
|
-
var
|
|
1285
|
-
|
|
1332
|
+
var _iterator6 = _createForOfIteratorHelper(importedSpecifiers(files)),
|
|
1333
|
+
_step6;
|
|
1286
1334
|
try {
|
|
1287
|
-
for (
|
|
1288
|
-
var specifier =
|
|
1335
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
1336
|
+
var specifier = _step6.value;
|
|
1289
1337
|
var pkg = packageOf(specifier);
|
|
1290
1338
|
if (!declared.has(pkg) || BASE_PROVIDED.has(pkg)) continue;
|
|
1291
1339
|
if (specifier.endsWith(".css")) {
|
|
@@ -1294,31 +1342,52 @@ function layerDepsOf(manifest) {
|
|
|
1294
1342
|
}
|
|
1295
1343
|
specifiers.add(specifier);
|
|
1296
1344
|
}
|
|
1345
|
+
// A package a STYLESHEET imports -- a font, typically -- is a stylesheet
|
|
1346
|
+
// and its files, with no JS entry to build. Left in, it is built as code,
|
|
1347
|
+
// fails, and is reported as skipped on every publish.
|
|
1348
|
+
} catch (err) {
|
|
1349
|
+
_iterator6.e(err);
|
|
1350
|
+
} finally {
|
|
1351
|
+
_iterator6.f();
|
|
1352
|
+
}
|
|
1353
|
+
var _iterator7 = _createForOfIteratorHelper(cssSpecifiersOf(files)),
|
|
1354
|
+
_step7;
|
|
1355
|
+
try {
|
|
1356
|
+
var _loop = function _loop() {
|
|
1357
|
+
var specifier = _step7.value;
|
|
1358
|
+
var pkg = packageOf(specifier);
|
|
1359
|
+
if (declared.has(pkg) && !_toConsumableArray(specifiers).some(function (s) {
|
|
1360
|
+
return packageOf(s) === pkg;
|
|
1361
|
+
})) cssOnly.add(pkg);
|
|
1362
|
+
};
|
|
1363
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
1364
|
+
_loop();
|
|
1365
|
+
}
|
|
1297
1366
|
|
|
1298
1367
|
// A declared dependency nothing imports still gets an entry, so that a
|
|
1299
1368
|
// project can add one and import it from the studio without a CI round-trip.
|
|
1300
1369
|
} catch (err) {
|
|
1301
|
-
|
|
1370
|
+
_iterator7.e(err);
|
|
1302
1371
|
} finally {
|
|
1303
|
-
|
|
1372
|
+
_iterator7.f();
|
|
1304
1373
|
}
|
|
1305
|
-
var
|
|
1306
|
-
|
|
1374
|
+
var _iterator8 = _createForOfIteratorHelper(declared),
|
|
1375
|
+
_step8;
|
|
1307
1376
|
try {
|
|
1308
|
-
var
|
|
1309
|
-
var name =
|
|
1377
|
+
var _loop2 = function _loop2() {
|
|
1378
|
+
var name = _step8.value;
|
|
1310
1379
|
if (cssOnly.has(name)) return 1; // continue
|
|
1311
1380
|
if (!_toConsumableArray(specifiers).some(function (specifier) {
|
|
1312
1381
|
return packageOf(specifier) === name;
|
|
1313
1382
|
})) specifiers.add(name);
|
|
1314
1383
|
};
|
|
1315
|
-
for (
|
|
1316
|
-
if (
|
|
1384
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
1385
|
+
if (_loop2()) continue;
|
|
1317
1386
|
}
|
|
1318
1387
|
} catch (err) {
|
|
1319
|
-
|
|
1388
|
+
_iterator8.e(err);
|
|
1320
1389
|
} finally {
|
|
1321
|
-
|
|
1390
|
+
_iterator8.f();
|
|
1322
1391
|
}
|
|
1323
1392
|
return _toConsumableArray(specifiers).sort();
|
|
1324
1393
|
}
|
|
@@ -1349,12 +1418,23 @@ var STUB_DIR = ".platform-vendor-stubs";
|
|
|
1349
1418
|
* into the project's stylesheet by the builder's CSS pass. Resolution is the
|
|
1350
1419
|
* project's own, so the version matches whatever its lockfile pinned.
|
|
1351
1420
|
*/
|
|
1352
|
-
function collectDependencyCss(_x22, _x23) {
|
|
1421
|
+
function collectDependencyCss(_x22, _x23, _x24) {
|
|
1353
1422
|
return _collectDependencyCss.apply(this, arguments);
|
|
1354
1423
|
}
|
|
1424
|
+
|
|
1425
|
+
/** `url(...)` with a relative target, quoted or not. */
|
|
1355
1426
|
function _collectDependencyCss() {
|
|
1356
|
-
_collectDependencyCss = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(dir, specifiers
|
|
1357
|
-
|
|
1427
|
+
_collectDependencyCss = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(dir, specifiers,
|
|
1428
|
+
/**
|
|
1429
|
+
* Where the files a stylesheet points at with `url(...)` go, base64, keyed
|
|
1430
|
+
* by the content-addressed name the rewritten `url()` now uses. Pass it to
|
|
1431
|
+
* the build as `dependencyAssets`, which publishes them under `/_app/a/`.
|
|
1432
|
+
*
|
|
1433
|
+
* Without it the stylesheets are carried as they are, and a relative `url()`
|
|
1434
|
+
* in one -- every font package's -- points at nothing once it is served.
|
|
1435
|
+
*/
|
|
1436
|
+
assets) {
|
|
1437
|
+
var require, css, _iterator15, _step15, specifier, file, _t0;
|
|
1358
1438
|
return _regenerator().w(function (_context8) {
|
|
1359
1439
|
while (1) switch (_context8.p = _context8.n) {
|
|
1360
1440
|
case 0:
|
|
@@ -1366,66 +1446,211 @@ function _collectDependencyCss() {
|
|
|
1366
1446
|
case 1:
|
|
1367
1447
|
require = createRequire(join(resolve(dir), "package.json"));
|
|
1368
1448
|
css = {};
|
|
1369
|
-
|
|
1449
|
+
_iterator15 = _createForOfIteratorHelper(specifiers);
|
|
1370
1450
|
_context8.p = 2;
|
|
1371
|
-
|
|
1451
|
+
_iterator15.s();
|
|
1372
1452
|
case 3:
|
|
1373
|
-
if ((
|
|
1374
|
-
_context8.n =
|
|
1453
|
+
if ((_step15 = _iterator15.n()).done) {
|
|
1454
|
+
_context8.n = 10;
|
|
1375
1455
|
break;
|
|
1376
1456
|
}
|
|
1377
|
-
specifier =
|
|
1457
|
+
specifier = _step15.value;
|
|
1458
|
+
file = void 0;
|
|
1378
1459
|
_context8.p = 4;
|
|
1379
|
-
|
|
1380
|
-
|
|
1460
|
+
file = require.resolve(specifier);
|
|
1461
|
+
_context8.n = 6;
|
|
1462
|
+
break;
|
|
1381
1463
|
case 5:
|
|
1464
|
+
_context8.p = 5;
|
|
1465
|
+
_context8.v;
|
|
1466
|
+
return _context8.a(3, 9);
|
|
1467
|
+
case 6:
|
|
1468
|
+
if (file.endsWith(".css")) {
|
|
1469
|
+
_context8.n = 7;
|
|
1470
|
+
break;
|
|
1471
|
+
}
|
|
1472
|
+
return _context8.a(3, 9);
|
|
1473
|
+
case 7:
|
|
1474
|
+
_context8.n = 8;
|
|
1475
|
+
return readDependencyStylesheet(file, assets, new Set());
|
|
1476
|
+
case 8:
|
|
1382
1477
|
css[specifier] = _context8.v;
|
|
1383
|
-
|
|
1478
|
+
case 9:
|
|
1479
|
+
_context8.n = 3;
|
|
1480
|
+
break;
|
|
1481
|
+
case 10:
|
|
1482
|
+
_context8.n = 12;
|
|
1384
1483
|
break;
|
|
1484
|
+
case 11:
|
|
1485
|
+
_context8.p = 11;
|
|
1486
|
+
_t0 = _context8.v;
|
|
1487
|
+
_iterator15.e(_t0);
|
|
1488
|
+
case 12:
|
|
1489
|
+
_context8.p = 12;
|
|
1490
|
+
_iterator15.f();
|
|
1491
|
+
return _context8.f(12);
|
|
1492
|
+
case 13:
|
|
1493
|
+
return _context8.a(2, css);
|
|
1494
|
+
}
|
|
1495
|
+
}, _callee8, null, [[4, 5], [2, 11, 12, 13]]);
|
|
1496
|
+
}));
|
|
1497
|
+
return _collectDependencyCss.apply(this, arguments);
|
|
1498
|
+
}
|
|
1499
|
+
var RELATIVE_URL = /url\(\s*(["']?)(?![a-z]+:|\/|#)([^"')]+)\1\s*\)/gi;
|
|
1500
|
+
|
|
1501
|
+
/**
|
|
1502
|
+
* A dependency's stylesheet, made self-contained.
|
|
1503
|
+
*
|
|
1504
|
+
* Its own relative `@import`s are inlined -- they point into the package, which
|
|
1505
|
+
* the browser build will never see -- and, given `assets`, every relative
|
|
1506
|
+
* `url()` is read, published as a content-addressed asset and pointed at it.
|
|
1507
|
+
* Names follow `resolveAsset`'s: the first 16 hex of the base64's SHA-256, and
|
|
1508
|
+
* the file's own extension.
|
|
1509
|
+
*/
|
|
1510
|
+
function readDependencyStylesheet(_x25, _x26, _x27) {
|
|
1511
|
+
return _readDependencyStylesheet.apply(this, arguments);
|
|
1512
|
+
}
|
|
1513
|
+
function _readDependencyStylesheet() {
|
|
1514
|
+
_readDependencyStylesheet = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(file, assets, seen) {
|
|
1515
|
+
var base, css, imports, _iterator16, _step16, match, target, inlined, rewrites, _iterator17, _step17, _match, reference, path, base64, hash, name, _t1, _t10, _t12;
|
|
1516
|
+
return _regenerator().w(function (_context9) {
|
|
1517
|
+
while (1) switch (_context9.p = _context9.n) {
|
|
1518
|
+
case 0:
|
|
1519
|
+
seen.add(file);
|
|
1520
|
+
base = dirname(file);
|
|
1521
|
+
_context9.n = 1;
|
|
1522
|
+
return readFile(file, "utf8");
|
|
1523
|
+
case 1:
|
|
1524
|
+
css = _context9.v;
|
|
1525
|
+
imports = _toConsumableArray(css.matchAll(/@import\s+(?:url\(\s*)?(["'])(\.{1,2}\/[^"']+)\1[^;]*;/g));
|
|
1526
|
+
_iterator16 = _createForOfIteratorHelper(imports);
|
|
1527
|
+
_context9.p = 2;
|
|
1528
|
+
_iterator16.s();
|
|
1529
|
+
case 3:
|
|
1530
|
+
if ((_step16 = _iterator16.n()).done) {
|
|
1531
|
+
_context9.n = 8;
|
|
1532
|
+
break;
|
|
1533
|
+
}
|
|
1534
|
+
match = _step16.value;
|
|
1535
|
+
target = join(base, match[2]);
|
|
1536
|
+
if (!seen.has(target)) {
|
|
1537
|
+
_context9.n = 4;
|
|
1538
|
+
break;
|
|
1539
|
+
}
|
|
1540
|
+
_t1 = "";
|
|
1541
|
+
_context9.n = 6;
|
|
1542
|
+
break;
|
|
1543
|
+
case 4:
|
|
1544
|
+
_context9.n = 5;
|
|
1545
|
+
return readDependencyStylesheet(target, assets, seen)["catch"](function () {
|
|
1546
|
+
return null;
|
|
1547
|
+
});
|
|
1548
|
+
case 5:
|
|
1549
|
+
_t1 = _context9.v;
|
|
1385
1550
|
case 6:
|
|
1386
|
-
|
|
1387
|
-
|
|
1551
|
+
inlined = _t1;
|
|
1552
|
+
// A missing file stays an import, so the builder names it.
|
|
1553
|
+
if (inlined !== null) css = css.replace(match[0], inlined);
|
|
1388
1554
|
case 7:
|
|
1389
|
-
|
|
1555
|
+
_context9.n = 3;
|
|
1390
1556
|
break;
|
|
1391
1557
|
case 8:
|
|
1392
|
-
|
|
1558
|
+
_context9.n = 10;
|
|
1393
1559
|
break;
|
|
1394
1560
|
case 9:
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1561
|
+
_context9.p = 9;
|
|
1562
|
+
_t10 = _context9.v;
|
|
1563
|
+
_iterator16.e(_t10);
|
|
1398
1564
|
case 10:
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
return
|
|
1565
|
+
_context9.p = 10;
|
|
1566
|
+
_iterator16.f();
|
|
1567
|
+
return _context9.f(10);
|
|
1402
1568
|
case 11:
|
|
1403
|
-
|
|
1569
|
+
if (assets) {
|
|
1570
|
+
_context9.n = 12;
|
|
1571
|
+
break;
|
|
1572
|
+
}
|
|
1573
|
+
return _context9.a(2, css);
|
|
1574
|
+
case 12:
|
|
1575
|
+
rewrites = new Map();
|
|
1576
|
+
_iterator17 = _createForOfIteratorHelper(css.matchAll(RELATIVE_URL));
|
|
1577
|
+
_context9.p = 13;
|
|
1578
|
+
_iterator17.s();
|
|
1579
|
+
case 14:
|
|
1580
|
+
if ((_step17 = _iterator17.n()).done) {
|
|
1581
|
+
_context9.n = 21;
|
|
1582
|
+
break;
|
|
1583
|
+
}
|
|
1584
|
+
_match = _step17.value;
|
|
1585
|
+
reference = _match[2].trim();
|
|
1586
|
+
if (!rewrites.has(reference)) {
|
|
1587
|
+
_context9.n = 15;
|
|
1588
|
+
break;
|
|
1589
|
+
}
|
|
1590
|
+
return _context9.a(3, 20);
|
|
1591
|
+
case 15:
|
|
1592
|
+
path = join(base, reference.split(/[?#]/)[0]);
|
|
1593
|
+
base64 = void 0;
|
|
1594
|
+
_context9.p = 16;
|
|
1595
|
+
_context9.n = 17;
|
|
1596
|
+
return readFile(path);
|
|
1597
|
+
case 17:
|
|
1598
|
+
base64 = _context9.v.toString("base64");
|
|
1599
|
+
_context9.n = 19;
|
|
1600
|
+
break;
|
|
1601
|
+
case 18:
|
|
1602
|
+
_context9.p = 18;
|
|
1603
|
+
_context9.v;
|
|
1604
|
+
return _context9.a(3, 20);
|
|
1605
|
+
case 19:
|
|
1606
|
+
hash = createHash("sha256").update(base64).digest("hex").slice(0, 16);
|
|
1607
|
+
name = "".concat(hash).concat(extname(path).toLowerCase());
|
|
1608
|
+
assets[name] = base64;
|
|
1609
|
+
rewrites.set(reference, "".concat(ASSET_BASE).concat(name));
|
|
1610
|
+
case 20:
|
|
1611
|
+
_context9.n = 14;
|
|
1612
|
+
break;
|
|
1613
|
+
case 21:
|
|
1614
|
+
_context9.n = 23;
|
|
1615
|
+
break;
|
|
1616
|
+
case 22:
|
|
1617
|
+
_context9.p = 22;
|
|
1618
|
+
_t12 = _context9.v;
|
|
1619
|
+
_iterator17.e(_t12);
|
|
1620
|
+
case 23:
|
|
1621
|
+
_context9.p = 23;
|
|
1622
|
+
_iterator17.f();
|
|
1623
|
+
return _context9.f(23);
|
|
1624
|
+
case 24:
|
|
1625
|
+
return _context9.a(2, css.replace(RELATIVE_URL, function (whole, _quote, reference) {
|
|
1626
|
+
var url = rewrites.get(reference.trim());
|
|
1627
|
+
return url ? "url(".concat(url, ")") : whole;
|
|
1628
|
+
}));
|
|
1404
1629
|
}
|
|
1405
|
-
},
|
|
1630
|
+
}, _callee9, null, [[16, 18], [13, 22, 23, 24], [2, 9, 10, 11]]);
|
|
1406
1631
|
}));
|
|
1407
|
-
return
|
|
1632
|
+
return _readDependencyStylesheet.apply(this, arguments);
|
|
1408
1633
|
}
|
|
1409
|
-
function buildVendorLayer(
|
|
1634
|
+
function buildVendorLayer(_x28, _x29, _x30, _x31) {
|
|
1410
1635
|
return _buildVendorLayer.apply(this, arguments);
|
|
1411
1636
|
}
|
|
1412
1637
|
function _buildVendorLayer() {
|
|
1413
|
-
_buildVendorLayer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1414
|
-
var modules,
|
|
1415
|
-
return _regenerator().w(function (
|
|
1416
|
-
while (1) switch (
|
|
1638
|
+
_buildVendorLayer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(dir, deps, css, platform) {
|
|
1639
|
+
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;
|
|
1640
|
+
return _regenerator().w(function (_context1) {
|
|
1641
|
+
while (1) switch (_context1.p = _context1.n) {
|
|
1417
1642
|
case 0:
|
|
1418
1643
|
if (!(deps.length === 0 && Object.keys(css).length === 0)) {
|
|
1419
|
-
|
|
1644
|
+
_context1.n = 1;
|
|
1420
1645
|
break;
|
|
1421
1646
|
}
|
|
1422
|
-
return
|
|
1647
|
+
return _context1.a(2, null);
|
|
1423
1648
|
case 1:
|
|
1424
1649
|
if (!(deps.length === 0)) {
|
|
1425
|
-
|
|
1650
|
+
_context1.n = 2;
|
|
1426
1651
|
break;
|
|
1427
1652
|
}
|
|
1428
|
-
return
|
|
1653
|
+
return _context1.a(2, {
|
|
1429
1654
|
rev: cssRev(css),
|
|
1430
1655
|
modules: {},
|
|
1431
1656
|
worker: {},
|
|
@@ -1437,14 +1662,14 @@ function _buildVendorLayer() {
|
|
|
1437
1662
|
});
|
|
1438
1663
|
case 2:
|
|
1439
1664
|
modules = {};
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1665
|
+
_iterator18 = _createForOfIteratorHelper(deps);
|
|
1666
|
+
_context1.p = 3;
|
|
1667
|
+
_loop3 = /*#__PURE__*/_regenerator().m(function _loop3() {
|
|
1443
1668
|
var specifier, name, clash;
|
|
1444
|
-
return _regenerator().w(function (
|
|
1445
|
-
while (1) switch (
|
|
1669
|
+
return _regenerator().w(function (_context0) {
|
|
1670
|
+
while (1) switch (_context0.n) {
|
|
1446
1671
|
case 0:
|
|
1447
|
-
specifier =
|
|
1672
|
+
specifier = _step18.value;
|
|
1448
1673
|
name = chunkNameFor(specifier);
|
|
1449
1674
|
clash = Object.entries(modules).find(function (_ref4) {
|
|
1450
1675
|
var _ref5 = _slicedToArray(_ref4, 2),
|
|
@@ -1452,38 +1677,38 @@ function _buildVendorLayer() {
|
|
|
1452
1677
|
return existing === name;
|
|
1453
1678
|
});
|
|
1454
1679
|
if (!clash) {
|
|
1455
|
-
|
|
1680
|
+
_context0.n = 1;
|
|
1456
1681
|
break;
|
|
1457
1682
|
}
|
|
1458
1683
|
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.");
|
|
1459
1684
|
case 1:
|
|
1460
1685
|
modules[specifier] = name;
|
|
1461
1686
|
case 2:
|
|
1462
|
-
return
|
|
1687
|
+
return _context0.a(2);
|
|
1463
1688
|
}
|
|
1464
|
-
},
|
|
1689
|
+
}, _loop3);
|
|
1465
1690
|
});
|
|
1466
|
-
|
|
1691
|
+
_iterator18.s();
|
|
1467
1692
|
case 4:
|
|
1468
|
-
if ((
|
|
1469
|
-
|
|
1693
|
+
if ((_step18 = _iterator18.n()).done) {
|
|
1694
|
+
_context1.n = 6;
|
|
1470
1695
|
break;
|
|
1471
1696
|
}
|
|
1472
|
-
return
|
|
1697
|
+
return _context1.d(_regeneratorValues(_loop3()), 5);
|
|
1473
1698
|
case 5:
|
|
1474
|
-
|
|
1699
|
+
_context1.n = 4;
|
|
1475
1700
|
break;
|
|
1476
1701
|
case 6:
|
|
1477
|
-
|
|
1702
|
+
_context1.n = 8;
|
|
1478
1703
|
break;
|
|
1479
1704
|
case 7:
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1705
|
+
_context1.p = 7;
|
|
1706
|
+
_t13 = _context1.v;
|
|
1707
|
+
_iterator18.e(_t13);
|
|
1483
1708
|
case 8:
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
return
|
|
1709
|
+
_context1.p = 8;
|
|
1710
|
+
_iterator18.f();
|
|
1711
|
+
return _context1.f(8);
|
|
1487
1712
|
case 9:
|
|
1488
1713
|
// `resolve` rather than `join`, and the CLI's own default argument is why.
|
|
1489
1714
|
//
|
|
@@ -1500,34 +1725,34 @@ function _buildVendorLayer() {
|
|
|
1500
1725
|
// path: the suites all build in a mkdtemp. The one caller that does not is
|
|
1501
1726
|
// the one a person uses.
|
|
1502
1727
|
stubs = join(resolve(dir), STUB_DIR);
|
|
1503
|
-
|
|
1728
|
+
_context1.n = 10;
|
|
1504
1729
|
return rm(stubs, {
|
|
1505
1730
|
recursive: true,
|
|
1506
1731
|
force: true
|
|
1507
1732
|
});
|
|
1508
1733
|
case 10:
|
|
1509
|
-
|
|
1734
|
+
_context1.n = 11;
|
|
1510
1735
|
return mkdir(stubs, {
|
|
1511
1736
|
recursive: true
|
|
1512
1737
|
});
|
|
1513
1738
|
case 11:
|
|
1514
|
-
|
|
1739
|
+
_context1.p = 11;
|
|
1515
1740
|
input = {};
|
|
1516
1741
|
_i3 = 0, _Object$entries3 = Object.entries(modules);
|
|
1517
1742
|
case 12:
|
|
1518
1743
|
if (!(_i3 < _Object$entries3.length)) {
|
|
1519
|
-
|
|
1744
|
+
_context1.n = 15;
|
|
1520
1745
|
break;
|
|
1521
1746
|
}
|
|
1522
1747
|
_Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2), specifier = _Object$entries3$_i[0], name = _Object$entries3$_i[1];
|
|
1523
1748
|
file = join(stubs, "".concat(name, ".js"));
|
|
1524
|
-
|
|
1749
|
+
_context1.n = 13;
|
|
1525
1750
|
return writeFile(file, stubSource(specifier));
|
|
1526
1751
|
case 13:
|
|
1527
1752
|
input[name] = file;
|
|
1528
1753
|
case 14:
|
|
1529
1754
|
_i3++;
|
|
1530
|
-
|
|
1755
|
+
_context1.n = 12;
|
|
1531
1756
|
break;
|
|
1532
1757
|
case 15:
|
|
1533
1758
|
// Fast path: one build with every entry, so shared code is shared. When it
|
|
@@ -1547,21 +1772,21 @@ function _buildVendorLayer() {
|
|
|
1547
1772
|
})[0];
|
|
1548
1773
|
};
|
|
1549
1774
|
usable = Object.values(modules);
|
|
1550
|
-
|
|
1775
|
+
_context1.n = 16;
|
|
1551
1776
|
return buildTargets(usable, input, join(stubs, "out"), false, platform)["catch"](function () {
|
|
1552
1777
|
return null;
|
|
1553
1778
|
});
|
|
1554
1779
|
case 16:
|
|
1555
|
-
built =
|
|
1780
|
+
built = _context1.v;
|
|
1556
1781
|
if (built) {
|
|
1557
|
-
|
|
1782
|
+
_context1.n = 32;
|
|
1558
1783
|
break;
|
|
1559
1784
|
}
|
|
1560
1785
|
usable = [];
|
|
1561
1786
|
_i4 = 0, _Object$values = Object.values(modules);
|
|
1562
1787
|
case 17:
|
|
1563
1788
|
if (!(_i4 < _Object$values.length)) {
|
|
1564
|
-
|
|
1789
|
+
_context1.n = 29;
|
|
1565
1790
|
break;
|
|
1566
1791
|
}
|
|
1567
1792
|
_name2 = _Object$values[_i4];
|
|
@@ -1575,44 +1800,44 @@ function _buildVendorLayer() {
|
|
|
1575
1800
|
// the builder, naming it.
|
|
1576
1801
|
worked = {};
|
|
1577
1802
|
reasons = [];
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1803
|
+
_iterator19 = _createForOfIteratorHelper(targetsFor(platform));
|
|
1804
|
+
_context1.p = 18;
|
|
1805
|
+
_iterator19.s();
|
|
1581
1806
|
case 19:
|
|
1582
|
-
if ((
|
|
1583
|
-
|
|
1807
|
+
if ((_step19 = _iterator19.n()).done) {
|
|
1808
|
+
_context1.n = 24;
|
|
1584
1809
|
break;
|
|
1585
1810
|
}
|
|
1586
|
-
target =
|
|
1587
|
-
|
|
1588
|
-
|
|
1811
|
+
target = _step19.value;
|
|
1812
|
+
_context1.p = 20;
|
|
1813
|
+
_context1.n = 21;
|
|
1589
1814
|
return buildTargets({
|
|
1590
1815
|
worker: target.name === "worker" ? [_name2] : [],
|
|
1591
1816
|
browser: target.name === "browser" ? [_name2] : []
|
|
1592
1817
|
}, input, join(stubs, "probe", target.name, _name2), true, platform);
|
|
1593
1818
|
case 21:
|
|
1594
1819
|
worked[target.name] = true;
|
|
1595
|
-
|
|
1820
|
+
_context1.n = 23;
|
|
1596
1821
|
break;
|
|
1597
1822
|
case 22:
|
|
1598
|
-
|
|
1599
|
-
|
|
1823
|
+
_context1.p = 22;
|
|
1824
|
+
_t14 = _context1.v;
|
|
1600
1825
|
worked[target.name] = false;
|
|
1601
|
-
reasons.push(firstLine(String((_message =
|
|
1826
|
+
reasons.push(firstLine(String((_message = _t14 === null || _t14 === void 0 ? void 0 : _t14.message) !== null && _message !== void 0 ? _message : _t14)));
|
|
1602
1827
|
case 23:
|
|
1603
|
-
|
|
1828
|
+
_context1.n = 19;
|
|
1604
1829
|
break;
|
|
1605
1830
|
case 24:
|
|
1606
|
-
|
|
1831
|
+
_context1.n = 26;
|
|
1607
1832
|
break;
|
|
1608
1833
|
case 25:
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1834
|
+
_context1.p = 25;
|
|
1835
|
+
_t15 = _context1.v;
|
|
1836
|
+
_iterator19.e(_t15);
|
|
1612
1837
|
case 26:
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
return
|
|
1838
|
+
_context1.p = 26;
|
|
1839
|
+
_iterator19.f();
|
|
1840
|
+
return _context1.f(26);
|
|
1616
1841
|
case 27:
|
|
1617
1842
|
if (worked.worker && worked.browser) usable.push(_name2);else if (worked.worker) {
|
|
1618
1843
|
usable.push(_name2);
|
|
@@ -1632,7 +1857,7 @@ function _buildVendorLayer() {
|
|
|
1632
1857
|
}
|
|
1633
1858
|
case 28:
|
|
1634
1859
|
_i4++;
|
|
1635
|
-
|
|
1860
|
+
_context1.n = 17;
|
|
1636
1861
|
break;
|
|
1637
1862
|
case 29:
|
|
1638
1863
|
for (_i5 = 0, _Object$entries4 = Object.entries(modules); _i5 < _Object$entries4.length; _i5++) {
|
|
@@ -1642,10 +1867,10 @@ function _buildVendorLayer() {
|
|
|
1642
1867
|
// Everything failed: a layer with no entries is the same as no layer, and
|
|
1643
1868
|
// the skip list is what the caller reports.
|
|
1644
1869
|
if (!(usable.length === 0)) {
|
|
1645
|
-
|
|
1870
|
+
_context1.n = 30;
|
|
1646
1871
|
break;
|
|
1647
1872
|
}
|
|
1648
|
-
return
|
|
1873
|
+
return _context1.a(2, {
|
|
1649
1874
|
rev: "none",
|
|
1650
1875
|
modules: {},
|
|
1651
1876
|
worker: {},
|
|
@@ -1656,7 +1881,7 @@ function _buildVendorLayer() {
|
|
|
1656
1881
|
workerOnlyReasons: workerOnlyReasons
|
|
1657
1882
|
});
|
|
1658
1883
|
case 30:
|
|
1659
|
-
|
|
1884
|
+
_context1.n = 31;
|
|
1660
1885
|
return buildTargets({
|
|
1661
1886
|
worker: usable,
|
|
1662
1887
|
browser: usable.filter(function (name) {
|
|
@@ -1664,9 +1889,9 @@ function _buildVendorLayer() {
|
|
|
1664
1889
|
})
|
|
1665
1890
|
}, input, join(stubs, "out"), false, platform);
|
|
1666
1891
|
case 31:
|
|
1667
|
-
built =
|
|
1892
|
+
built = _context1.v;
|
|
1668
1893
|
case 32:
|
|
1669
|
-
return
|
|
1894
|
+
return _context1.a(2, {
|
|
1670
1895
|
rev: "".concat(built.rev).concat(cssRev(css) ? "-".concat(cssRev(css)) : ""),
|
|
1671
1896
|
modules: modules,
|
|
1672
1897
|
worker: built.worker,
|
|
@@ -1677,18 +1902,18 @@ function _buildVendorLayer() {
|
|
|
1677
1902
|
workerOnlyReasons: workerOnlyReasons
|
|
1678
1903
|
});
|
|
1679
1904
|
case 33:
|
|
1680
|
-
|
|
1681
|
-
|
|
1905
|
+
_context1.p = 33;
|
|
1906
|
+
_context1.n = 34;
|
|
1682
1907
|
return rm(stubs, {
|
|
1683
1908
|
recursive: true,
|
|
1684
1909
|
force: true
|
|
1685
1910
|
});
|
|
1686
1911
|
case 34:
|
|
1687
|
-
return
|
|
1912
|
+
return _context1.f(33);
|
|
1688
1913
|
case 35:
|
|
1689
|
-
return
|
|
1914
|
+
return _context1.a(2);
|
|
1690
1915
|
}
|
|
1691
|
-
},
|
|
1916
|
+
}, _callee0, null, [[20, 22], [18, 25, 26, 27], [11,, 33, 35], [3, 7, 8, 9]]);
|
|
1692
1917
|
}));
|
|
1693
1918
|
return _buildVendorLayer.apply(this, arguments);
|
|
1694
1919
|
}
|