@wyw-in-js/transform 0.1.1 → 0.2.0
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/esm/index.js +4 -1
- package/esm/index.js.map +1 -1
- package/esm/options/loadBabelOptions.js +1 -1
- package/esm/options/loadBabelOptions.js.map +1 -1
- package/esm/plugins/babel-transform.js +2 -2
- package/esm/plugins/babel-transform.js.map +1 -1
- package/esm/plugins/collector.js +4 -4
- package/esm/plugins/collector.js.map +1 -1
- package/esm/plugins/preeval.js +11 -11
- package/esm/plugins/preeval.js.map +1 -1
- package/esm/plugins/shaker.js +5 -5
- package/esm/plugins/shaker.js.map +1 -1
- package/esm/shaker.js +2 -2
- package/esm/shaker.js.map +1 -1
- package/esm/transform/Entrypoint.helpers.js +1 -2
- package/esm/transform/Entrypoint.helpers.js.map +1 -1
- package/esm/transform/Entrypoint.js +4 -4
- package/esm/transform/Entrypoint.js.map +1 -1
- package/esm/transform/generators/collect.js +3 -2
- package/esm/transform/generators/collect.js.map +1 -1
- package/esm/transform/generators/evalFile.js +6 -6
- package/esm/transform/generators/evalFile.js.map +1 -1
- package/esm/transform/generators/extract.js +18 -14
- package/esm/transform/generators/extract.js.map +1 -1
- package/esm/transform/generators/transform.js +2 -2
- package/esm/transform/generators/transform.js.map +1 -1
- package/esm/transform/generators/workflow.js +3 -3
- package/esm/transform/generators/workflow.js.map +1 -1
- package/esm/transform/helpers/{loadLinariaOptions.js → loadWywOptions.js} +5 -5
- package/esm/transform/helpers/loadWywOptions.js.map +1 -0
- package/esm/transform.js +11 -10
- package/esm/transform.js.map +1 -1
- package/esm/types.js.map +1 -1
- package/esm/utils/ShakerMetadata.js +1 -1
- package/esm/utils/ShakerMetadata.js.map +1 -1
- package/esm/utils/{addIdentifierToLinariaPreval.js → addIdentifierToWywPreval.js} +10 -10
- package/esm/utils/addIdentifierToWywPreval.js.map +1 -0
- package/esm/utils/collectExportsAndImports.js +141 -53
- package/esm/utils/collectExportsAndImports.js.map +1 -1
- package/esm/utils/collectTemplateDependencies.js +2 -2
- package/esm/utils/collectTemplateDependencies.js.map +1 -1
- package/esm/utils/getTagProcessor.js +1 -1
- package/esm/utils/getTagProcessor.js.map +1 -1
- package/esm/utils/hasWywPreval.js +7 -0
- package/esm/utils/hasWywPreval.js.map +1 -0
- package/lib/index.js +28 -4
- package/lib/index.js.map +1 -1
- package/lib/options/loadBabelOptions.js +1 -1
- package/lib/options/loadBabelOptions.js.map +1 -1
- package/lib/plugins/babel-transform.js +2 -2
- package/lib/plugins/babel-transform.js.map +1 -1
- package/lib/plugins/collector.js +4 -4
- package/lib/plugins/collector.js.map +1 -1
- package/lib/plugins/preeval.js +11 -11
- package/lib/plugins/preeval.js.map +1 -1
- package/lib/plugins/shaker.js +5 -5
- package/lib/plugins/shaker.js.map +1 -1
- package/lib/shaker.js +2 -2
- package/lib/shaker.js.map +1 -1
- package/lib/transform/Entrypoint.helpers.js +1 -2
- package/lib/transform/Entrypoint.helpers.js.map +1 -1
- package/lib/transform/Entrypoint.js +4 -4
- package/lib/transform/Entrypoint.js.map +1 -1
- package/lib/transform/generators/collect.js +1 -1
- package/lib/transform/generators/collect.js.map +1 -1
- package/lib/transform/generators/evalFile.js +6 -6
- package/lib/transform/generators/evalFile.js.map +1 -1
- package/lib/transform/generators/extract.js +18 -14
- package/lib/transform/generators/extract.js.map +1 -1
- package/lib/transform/generators/transform.js +2 -2
- package/lib/transform/generators/transform.js.map +1 -1
- package/lib/transform/generators/workflow.js +3 -3
- package/lib/transform/generators/workflow.js.map +1 -1
- package/lib/transform/helpers/{loadLinariaOptions.js → loadWywOptions.js} +6 -6
- package/lib/transform/helpers/loadWywOptions.js.map +1 -0
- package/lib/transform/helpers/withDefaultServices.js +2 -2
- package/lib/transform/helpers/withDefaultServices.js.map +1 -1
- package/lib/transform.js +11 -10
- package/lib/transform.js.map +1 -1
- package/lib/types.js.map +1 -1
- package/lib/utils/ShakerMetadata.js +1 -1
- package/lib/utils/ShakerMetadata.js.map +1 -1
- package/lib/utils/{addIdentifierToLinariaPreval.js → addIdentifierToWywPreval.js} +12 -12
- package/lib/utils/addIdentifierToWywPreval.js.map +1 -0
- package/lib/utils/collectExportsAndImports.js +141 -53
- package/lib/utils/collectExportsAndImports.js.map +1 -1
- package/lib/utils/collectTemplateDependencies.js +2 -2
- package/lib/utils/collectTemplateDependencies.js.map +1 -1
- package/lib/utils/getTagProcessor.js +2 -2
- package/lib/utils/getTagProcessor.js.map +1 -1
- package/lib/utils/hasWywPreval.js +13 -0
- package/lib/utils/hasWywPreval.js.map +1 -0
- package/lib/vm/createVmContext.js +2 -2
- package/lib/vm/createVmContext.js.map +1 -1
- package/package.json +24 -21
- package/types/index.d.ts +5 -2
- package/types/index.js +9 -3
- package/types/options/loadBabelOptions.js +1 -1
- package/types/plugins/babel-transform.js +2 -2
- package/types/plugins/collector.js +4 -4
- package/types/plugins/preeval.js +11 -11
- package/types/plugins/shaker.js +5 -5
- package/types/shaker.js +2 -2
- package/types/transform/Entrypoint.d.ts +1 -1
- package/types/transform/Entrypoint.helpers.js +3 -3
- package/types/transform/Entrypoint.js +4 -4
- package/types/transform/generators/collect.js +1 -1
- package/types/transform/generators/evalFile.js +7 -7
- package/types/transform/generators/extract.js +21 -12
- package/types/transform/generators/transform.js +2 -4
- package/types/transform/generators/workflow.js +3 -3
- package/types/transform/helpers/{loadLinariaOptions.d.ts → loadWywOptions.d.ts} +1 -1
- package/types/transform/helpers/{loadLinariaOptions.js → loadWywOptions.js} +19 -19
- package/types/transform.d.ts +7 -6
- package/types/transform.js +11 -10
- package/types/types.d.ts +1 -1
- package/types/utils/ShakerMetadata.d.ts +1 -1
- package/types/utils/ShakerMetadata.js +1 -1
- package/types/utils/addIdentifierToWywPreval.d.ts +4 -0
- package/types/utils/{addIdentifierToLinariaPreval.js → addIdentifierToWywPreval.js} +12 -12
- package/types/utils/collectExportsAndImports.js +157 -58
- package/types/utils/collectTemplateDependencies.d.ts +1 -1
- package/types/utils/collectTemplateDependencies.js +2 -2
- package/types/utils/getTagProcessor.js +2 -2
- package/types/utils/hasWywPreval.d.ts +4 -0
- package/types/utils/{hasLinariaPreval.js → hasWywPreval.js} +3 -3
- package/esm/transform/helpers/loadLinariaOptions.js.map +0 -1
- package/esm/utils/addIdentifierToLinariaPreval.js.map +0 -1
- package/esm/utils/findPackageJSON.js +0 -26
- package/esm/utils/findPackageJSON.js.map +0 -1
- package/esm/utils/hasLinariaPreval.js +0 -7
- package/esm/utils/hasLinariaPreval.js.map +0 -1
- package/lib/transform/helpers/loadLinariaOptions.js.map +0 -1
- package/lib/utils/addIdentifierToLinariaPreval.js.map +0 -1
- package/lib/utils/findPackageJSON.js +0 -35
- package/lib/utils/findPackageJSON.js.map +0 -1
- package/lib/utils/hasLinariaPreval.js +0 -13
- package/lib/utils/hasLinariaPreval.js.map +0 -1
- package/types/utils/addIdentifierToLinariaPreval.d.ts +0 -4
- package/types/utils/findPackageJSON.d.ts +0 -1
- package/types/utils/findPackageJSON.js +0 -56
- package/types/utils/hasLinariaPreval.d.ts +0 -4
|
@@ -250,21 +250,60 @@ function getCalleeName(path) {
|
|
|
250
250
|
}
|
|
251
251
|
return undefined;
|
|
252
252
|
}
|
|
253
|
-
|
|
254
|
-
const name = getCalleeName(
|
|
253
|
+
const matchCall = (p, rules) => {
|
|
254
|
+
const name = getCalleeName(p);
|
|
255
255
|
if (name === undefined) {
|
|
256
|
-
return
|
|
256
|
+
return false;
|
|
257
257
|
}
|
|
258
|
-
|
|
258
|
+
return rules.some(([n, ...args]) => {
|
|
259
|
+
if (name !== n) return false;
|
|
260
|
+
const fnArgs = p.get('arguments');
|
|
261
|
+
if (fnArgs.length !== args.length) return false;
|
|
262
|
+
return args.every((arg, i) => {
|
|
263
|
+
if (arg === '*') return true;
|
|
264
|
+
if (typeof arg === 'function') return arg(fnArgs[i]);
|
|
265
|
+
return arg === fnArgs[i];
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
function getImportExportTypeByInteropFunction(path, argPath) {
|
|
270
|
+
if (matchCall(path, [['__exportStar', argPath, p => (0, _isExports.isExports)(p)]])) {
|
|
259
271
|
return 're-export:*';
|
|
260
272
|
}
|
|
261
|
-
if (
|
|
273
|
+
if (matchCall(path, [['_interopRequireDefault', argPath],
|
|
274
|
+
// babel and swc <1.3.50
|
|
275
|
+
['_interop_require_default', argPath],
|
|
276
|
+
// swc >=1.3.50
|
|
277
|
+
['__importDefault', argPath] // ?
|
|
278
|
+
])) {
|
|
262
279
|
return 'default';
|
|
263
280
|
}
|
|
264
|
-
if (
|
|
281
|
+
if (matchCall(path, [['_interopRequireWildcard', argPath],
|
|
282
|
+
// babel and swc <1.3.50
|
|
283
|
+
['_interop_require_wildcard', argPath],
|
|
284
|
+
// swc >=1.3.50
|
|
285
|
+
['__importStar', argPath],
|
|
286
|
+
// ?
|
|
287
|
+
['__toESM', argPath],
|
|
288
|
+
// esbuild >=0.14.7
|
|
289
|
+
['__toModule', argPath] // esbuild <0.14.7
|
|
290
|
+
])) {
|
|
265
291
|
return 'import:*';
|
|
266
292
|
}
|
|
267
|
-
if (
|
|
293
|
+
if (matchCall(path, [['_extends', isEmptyObject, argPath],
|
|
294
|
+
// babel and swc
|
|
295
|
+
['__rest', argPath, isArrayExpression],
|
|
296
|
+
// tsc and esbuild <=0.11.3
|
|
297
|
+
['__objRest', argPath, isArrayExpression],
|
|
298
|
+
// esbuild >0.11.3
|
|
299
|
+
['_objectWithoutProperties', argPath, isArrayExpression],
|
|
300
|
+
// babel and swc <1.3.50
|
|
301
|
+
['_object_without_properties', argPath, isArrayExpression],
|
|
302
|
+
// swc >=1.3.50
|
|
303
|
+
['_objectDestructuringEmpty', argPath],
|
|
304
|
+
// swc <1.3.50
|
|
305
|
+
['_object_destructuring_empty', argPath] // swc >=1.3.50
|
|
306
|
+
])) {
|
|
268
307
|
return 'import:*';
|
|
269
308
|
}
|
|
270
309
|
return undefined;
|
|
@@ -278,6 +317,31 @@ function isAlreadyProcessed(path) {
|
|
|
278
317
|
}
|
|
279
318
|
return false;
|
|
280
319
|
}
|
|
320
|
+
function isRequireCall(path) {
|
|
321
|
+
return path.isCallExpression() && (0, _isRequire.isRequire)(path.get('callee'));
|
|
322
|
+
}
|
|
323
|
+
function isEmptyObject(path) {
|
|
324
|
+
return path.isObjectExpression() && path.node.properties.length === 0;
|
|
325
|
+
}
|
|
326
|
+
function isArrayExpression(path) {
|
|
327
|
+
return path.isArrayExpression();
|
|
328
|
+
}
|
|
329
|
+
function isCallExpression(pathOrName) {
|
|
330
|
+
if (typeof pathOrName === 'string') {
|
|
331
|
+
return p => p.isCallExpression() && p.get('callee').isIdentifier({
|
|
332
|
+
name: pathOrName
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
return pathOrName.isCallExpression();
|
|
336
|
+
}
|
|
337
|
+
function isObjectExpression(path) {
|
|
338
|
+
return path.isObjectExpression();
|
|
339
|
+
}
|
|
340
|
+
function isIdentifier(name) {
|
|
341
|
+
return path => path.isIdentifier({
|
|
342
|
+
name
|
|
343
|
+
});
|
|
344
|
+
}
|
|
281
345
|
function collectFromRequire(path, state) {
|
|
282
346
|
if (!(0, _isRequire.isRequire)(path)) return;
|
|
283
347
|
|
|
@@ -302,10 +366,10 @@ function collectFromRequire(path, state) {
|
|
|
302
366
|
parentPath: container,
|
|
303
367
|
key
|
|
304
368
|
} = callExpression;
|
|
305
|
-
if (container.isCallExpression()
|
|
369
|
+
if (container.isCallExpression()) {
|
|
306
370
|
// It may be transpiled import such as
|
|
307
371
|
// `var _atomic = _interopRequireDefault(require("@linaria/atomic"));`
|
|
308
|
-
const imported = getImportExportTypeByInteropFunction(container);
|
|
372
|
+
const imported = getImportExportTypeByInteropFunction(container, callExpression);
|
|
309
373
|
if (!imported) {
|
|
310
374
|
// It's not a transpiled import.
|
|
311
375
|
// TODO: Can we guess that it's a namespace import?
|
|
@@ -562,10 +626,7 @@ function collectFromExports(path, state) {
|
|
|
562
626
|
// It is `exports.foo = void 0`
|
|
563
627
|
return;
|
|
564
628
|
}
|
|
565
|
-
|
|
566
|
-
name
|
|
567
|
-
} = property.node;
|
|
568
|
-
if (name === '__esModule') {
|
|
629
|
+
if (exportName === '__esModule') {
|
|
569
630
|
// eslint-disable-next-line no-param-reassign
|
|
570
631
|
state.isEsModule = true;
|
|
571
632
|
return;
|
|
@@ -632,7 +693,10 @@ function unfoldNamespaceImport(importItem) {
|
|
|
632
693
|
if (!(binding !== null && binding !== void 0 && binding.referenced)) {
|
|
633
694
|
// Imported namespace is not referenced and probably not used,
|
|
634
695
|
// but it can have side effects, so we should keep it as is
|
|
635
|
-
return [
|
|
696
|
+
return [{
|
|
697
|
+
...importItem,
|
|
698
|
+
imported: 'side-effect'
|
|
699
|
+
}];
|
|
636
700
|
}
|
|
637
701
|
for (const referencePath of (_binding$referencePat = binding === null || binding === void 0 ? void 0 : binding.referencePaths) !== null && _binding$referencePat !== void 0 ? _binding$referencePat : []) {
|
|
638
702
|
var _binding$referencePat;
|
|
@@ -675,7 +739,7 @@ function unfoldNamespaceImport(importItem) {
|
|
|
675
739
|
}
|
|
676
740
|
if (parentPath !== null && parentPath !== void 0 && parentPath.isCallExpression() && referencePath.listKey === 'arguments') {
|
|
677
741
|
// The defined variable is used as a function argument. Let's try to figure out what is imported.
|
|
678
|
-
const importType = getImportExportTypeByInteropFunction(parentPath);
|
|
742
|
+
const importType = getImportExportTypeByInteropFunction(parentPath, referencePath);
|
|
679
743
|
if (!importType) {
|
|
680
744
|
// Imported value is used as an unknown function argument,
|
|
681
745
|
// so we can't predict usage and import it as is.
|
|
@@ -821,8 +885,10 @@ function collectFromAssignmentExpression(path, state) {
|
|
|
821
885
|
let exported;
|
|
822
886
|
if (left.isMemberExpression() && (0, _isExports.isExports)(left.get('object'))) {
|
|
823
887
|
const property = left.get('property');
|
|
824
|
-
if (property.isIdentifier()) {
|
|
888
|
+
if (!left.node.computed && property.isIdentifier()) {
|
|
825
889
|
exported = property.node.name;
|
|
890
|
+
} else if (left.node.computed && property.isStringLiteral()) {
|
|
891
|
+
exported = property.node.value;
|
|
826
892
|
}
|
|
827
893
|
} else if ((0, _isExports.isExports)(left)) {
|
|
828
894
|
// module.exports = ...
|
|
@@ -831,9 +897,23 @@ function collectFromAssignmentExpression(path, state) {
|
|
|
831
897
|
}
|
|
832
898
|
}
|
|
833
899
|
if (!exported) return;
|
|
834
|
-
if (
|
|
900
|
+
if (exported === '__esModule') {
|
|
835
901
|
// eslint-disable-next-line no-param-reassign
|
|
836
|
-
state.
|
|
902
|
+
state.isEsModule = true;
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
if (!isRequireCall(right)) {
|
|
906
|
+
const relatedImport = state.imports.find(imp => imp.local === right);
|
|
907
|
+
if (relatedImport) {
|
|
908
|
+
state.reexports.push({
|
|
909
|
+
exported,
|
|
910
|
+
...relatedImport
|
|
911
|
+
});
|
|
912
|
+
} else {
|
|
913
|
+
// eslint-disable-next-line no-param-reassign
|
|
914
|
+
state.exports[exported] = right;
|
|
915
|
+
}
|
|
916
|
+
path.skip();
|
|
837
917
|
return;
|
|
838
918
|
}
|
|
839
919
|
const sourcePath = (_right$get = right.get('arguments')) === null || _right$get === void 0 ? void 0 : _right$get[0];
|
|
@@ -854,10 +934,9 @@ function collectFromAssignmentExpression(path, state) {
|
|
|
854
934
|
});
|
|
855
935
|
path.skip();
|
|
856
936
|
}
|
|
857
|
-
function
|
|
937
|
+
function collectAllFromCall(path, require, state) {
|
|
858
938
|
var _requireCall$get;
|
|
859
|
-
const
|
|
860
|
-
if (!(0, _isExports.isExports)(exports)) return;
|
|
939
|
+
const requireCall = typeof require === 'number' ? path.get('arguments')[require] : require;
|
|
861
940
|
if (!requireCall.isCallExpression()) return;
|
|
862
941
|
const callee = requireCall.get('callee');
|
|
863
942
|
const sourcePath = (_requireCall$get = requireCall.get('arguments')) === null || _requireCall$get === void 0 ? void 0 : _requireCall$get[0];
|
|
@@ -887,25 +966,32 @@ function collectFromMap(map, state) {
|
|
|
887
966
|
addExport(returnValue, exported, state);
|
|
888
967
|
});
|
|
889
968
|
}
|
|
890
|
-
function
|
|
891
|
-
const
|
|
892
|
-
if (!sourceExports.isIdentifier({
|
|
893
|
-
name: 'source_exports'
|
|
894
|
-
})) return;
|
|
969
|
+
function collectMapFromCall(path, mapPosition, state) {
|
|
970
|
+
const map = path.get('arguments')[mapPosition];
|
|
895
971
|
if (!map.isObjectExpression()) return;
|
|
896
972
|
collectFromMap(map, state);
|
|
897
973
|
path.skip();
|
|
898
974
|
}
|
|
899
975
|
function collectFromEsbuildReExportCall(path, state) {
|
|
900
976
|
var _requireCall$get2;
|
|
901
|
-
const [sourceExports,
|
|
977
|
+
const [sourceExports, someCall, exports] = path.get('arguments');
|
|
902
978
|
if (!sourceExports.isIdentifier({
|
|
903
979
|
name: 'source_exports'
|
|
904
|
-
})) return;
|
|
905
|
-
if (!
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
980
|
+
}) && !(0, _isExports.isExports)(sourceExports)) return;
|
|
981
|
+
if (!someCall.isCallExpression()) return;
|
|
982
|
+
let requireCall = someCall;
|
|
983
|
+
while (!(0, _isRequire.isRequire)(requireCall.get('callee'))) {
|
|
984
|
+
const args = requireCall.get('arguments');
|
|
985
|
+
if (args.length !== 1) {
|
|
986
|
+
return;
|
|
987
|
+
}
|
|
988
|
+
const firstArg = args[0];
|
|
989
|
+
if (!firstArg.isCallExpression()) {
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
992
|
+
requireCall = firstArg;
|
|
993
|
+
}
|
|
994
|
+
if (exports !== undefined && !(0, _isExports.isExports)(exports)) return;
|
|
909
995
|
const sourcePath = (_requireCall$get2 = requireCall.get('arguments')) === null || _requireCall$get2 === void 0 ? void 0 : _requireCall$get2[0];
|
|
910
996
|
if (!sourcePath.isStringLiteral()) return;
|
|
911
997
|
state.reexports.push({
|
|
@@ -916,41 +1002,43 @@ function collectFromEsbuildReExportCall(path, state) {
|
|
|
916
1002
|
});
|
|
917
1003
|
path.skip();
|
|
918
1004
|
}
|
|
919
|
-
function collectFromSwcExportCall(path, state) {
|
|
920
|
-
const [exports, map] = path.get('arguments');
|
|
921
|
-
if (!(0, _isExports.isExports)(exports)) return;
|
|
922
|
-
if (!map.isObjectExpression()) return;
|
|
923
|
-
collectFromMap(map, state);
|
|
924
|
-
path.skip();
|
|
925
|
-
}
|
|
926
1005
|
function collectFromCallExpression(path, state) {
|
|
927
1006
|
const maybeExportStart = path.get('callee');
|
|
928
1007
|
if (!maybeExportStart.isIdentifier()) {
|
|
929
1008
|
return;
|
|
930
1009
|
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
} = maybeExportStart.node;
|
|
1010
|
+
if (matchCall(path, [['__exportStar', _isExports.isExports, isCallExpression('__toModule')]])) {
|
|
1011
|
+
// __exportStar(exports, __toModule(require('…')));
|
|
934
1012
|
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
collectFromExportStarCall(path, state);
|
|
1013
|
+
const secondArg = path.get('arguments')[1];
|
|
1014
|
+
collectAllFromCall(path, secondArg.get('arguments')[0], state);
|
|
938
1015
|
return;
|
|
939
1016
|
}
|
|
940
1017
|
|
|
941
|
-
// swc
|
|
942
|
-
if (
|
|
943
|
-
|
|
1018
|
+
// TypeScript & swc
|
|
1019
|
+
if (matchCall(path, [['__exportStart', isRequireCall, _isExports.isExports], ['_exportStar', isRequireCall, _isExports.isExports], ['_export_star', isRequireCall, _isExports.isExports], ['__export', isRequireCall] // TypeScript <=3.8.3
|
|
1020
|
+
])) {
|
|
1021
|
+
collectAllFromCall(path, 0, state);
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
if (matchCall(path, [['_export', _isExports.isExports, isObjectExpression]])) {
|
|
1025
|
+
collectMapFromCall(path, 1, state);
|
|
1026
|
+
return;
|
|
944
1027
|
}
|
|
945
|
-
if (
|
|
946
|
-
|
|
1028
|
+
if (matchCall(path, [['_extends', isEmptyObject, isRequireCall] // swc <=1.3.16
|
|
1029
|
+
])) {
|
|
1030
|
+
collectAllFromCall(path, 1, state);
|
|
1031
|
+
return;
|
|
947
1032
|
}
|
|
948
1033
|
|
|
949
1034
|
// esbuild
|
|
950
|
-
if (
|
|
951
|
-
|
|
1035
|
+
if (matchCall(path, [['__export', _isExports.isExports, isObjectExpression], ['__export', isIdentifier('source_exports'), isObjectExpression]])) {
|
|
1036
|
+
collectMapFromCall(path, 1, state);
|
|
1037
|
+
return;
|
|
952
1038
|
}
|
|
953
|
-
if (
|
|
1039
|
+
if (matchCall(path, [
|
|
1040
|
+
// Different variants of re-exports in esbuild
|
|
1041
|
+
['__reExport', isIdentifier('source_exports'), isCallExpression, _isExports.isExports], ['__reExport', isIdentifier('source_exports'), isCallExpression], ['__reExport', _isExports.isExports, isCallExpression]])) {
|
|
954
1042
|
collectFromEsbuildReExportCall(path, state);
|
|
955
1043
|
}
|
|
956
1044
|
}
|