@jsenv/plugin-transpilation 1.6.1 → 1.6.3

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.
Files changed (31) hide show
  1. package/package.json +3 -3
  2. package/src/as_js_module/convert_js_classic_to_js_module.js +2 -0
  3. package/src/as_js_module/jsenv_plugin_as_js_module.js +1 -0
  4. package/src/babel/babel_helper_directory/README.md +1 -1
  5. package/src/babel/babel_helper_directory/babel_helpers/applyDecs2311/applyDecs2311.js +232 -0
  6. package/src/babel/babel_helper_directory/babel_helpers/assertClassBrand/assertClassBrand.js +9 -0
  7. package/src/babel/babel_helper_directory/babel_helpers/checkPrivateRedeclaration/checkPrivateRedeclaration.js +8 -0
  8. package/src/babel/babel_helper_directory/babel_helpers/classPrivateFieldGet2/classPrivateFieldGet2.js +8 -0
  9. package/src/babel/babel_helper_directory/babel_helpers/classPrivateFieldInitSpec/classPrivateFieldInitSpec.js +9 -0
  10. package/src/babel/babel_helper_directory/babel_helpers/classPrivateFieldSet2/classPrivateFieldSet2.js +9 -0
  11. package/src/babel/babel_helper_directory/babel_helpers/classPrivateGetter/classPrivateGetter.js +8 -0
  12. package/src/babel/babel_helper_directory/babel_helpers/classPrivateMethodInitSpec/classPrivateMethodInitSpec.js +9 -0
  13. package/src/babel/babel_helper_directory/babel_helpers/classPrivateSetter/classPrivateSetter.js +9 -0
  14. package/src/babel/babel_helper_directory/babel_helpers/classStaticPrivateFieldDestructureSet/classStaticPrivateFieldDestructureSet.js +10 -0
  15. package/src/babel/babel_helper_directory/babel_helpers/regenerator/regenerator.js +182 -0
  16. package/src/babel/babel_helper_directory/babel_helpers/regeneratorAsync/regeneratorAsync.js +9 -0
  17. package/src/babel/babel_helper_directory/babel_helpers/regeneratorAsyncGen/regeneratorAsyncGen.js +7 -0
  18. package/src/babel/babel_helper_directory/babel_helpers/regeneratorAsyncIterator/regeneratorAsyncIterator.js +43 -0
  19. package/src/babel/babel_helper_directory/babel_helpers/regeneratorDefine/regeneratorDefine.js +33 -0
  20. package/src/babel/babel_helper_directory/babel_helpers/regeneratorKeys/regeneratorKeys.js +21 -0
  21. package/src/babel/babel_helper_directory/babel_helpers/regeneratorValues/regeneratorValues.js +25 -0
  22. package/src/babel/babel_helper_directory/babel_helpers/superPropGet/superPropGet.js +10 -0
  23. package/src/babel/babel_helper_directory/babel_helpers/superPropSet/superPropSet.js +7 -0
  24. package/src/babel/babel_helper_directory/babel_helpers/toSetter/toSetter.js +11 -0
  25. package/src/babel/babel_helper_directory/babel_helpers/tsRewriteRelativeImportExtensions/tsRewriteRelativeImportExtensions.js +9 -0
  26. package/src/babel/babel_helper_directory/babel_helpers/usingCtx/usingCtx.js +96 -0
  27. package/src/babel/babel_plugins_compatibility.js +36 -34
  28. package/src/babel/jsenv_plugin_babel.js +1 -0
  29. package/src/css/apply_css_transpilation.js +13 -2
  30. package/src/js_module_fallback/jsenv_plugin_js_module_conversion.js +1 -0
  31. package/src/js_module_fallback/jsenv_plugin_top_level_await.js +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-transpilation",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "type": "module",
5
5
  "description": "TODO",
6
6
  "repository": {
@@ -48,8 +48,8 @@
48
48
  "@babel/plugin-transform-typeof-symbol": "7.29.7",
49
49
  "@babel/plugin-transform-unicode-property-regex": "7.29.7",
50
50
  "@babel/plugin-transform-unicode-regex": "7.29.7",
51
- "@jsenv/ast": "6.9.2",
52
- "@jsenv/js-module-fallback": "1.5.1",
51
+ "@jsenv/ast": "6.9.3",
52
+ "@jsenv/js-module-fallback": "1.5.2",
53
53
  "@jsenv/sourcemap": "1.4.2",
54
54
  "@jsenv/urls": "2.9.10",
55
55
  "@jsenv/utils": "2.3.1",
@@ -7,6 +7,7 @@ export const convertJsClassicToJsModule = async ({
7
7
  inputSourcemap,
8
8
  inputUrl,
9
9
  outputUrl,
10
+ generateSourcemap = true,
10
11
  }) => {
11
12
  const { code, map } = await applyBabelPlugins({
12
13
  babelPlugins: [[babelPluginReplaceTopLevelThis, { isWebWorker }]],
@@ -14,6 +15,7 @@ export const convertJsClassicToJsModule = async ({
14
15
  inputIsJsModule: false,
15
16
  inputUrl,
16
17
  outputUrl,
18
+ options: { sourceMaps: generateSourcemap },
17
19
  });
18
20
  const sourcemap = composeTwoSourcemaps(inputSourcemap, map);
19
21
  return {
@@ -48,6 +48,7 @@ export const jsenvPluginAsJsModule = () => {
48
48
  inputUrl: jsClassicUrlInfo.url,
49
49
  outputUrl: jsClassicUrlInfo.generatedUrl,
50
50
  isWebWorker: isWebWorkerUrlInfo(urlInfo),
51
+ generateSourcemap: urlInfo.context.sourcemapsEnabled,
51
52
  });
52
53
  return {
53
54
  content,
@@ -2,7 +2,7 @@
2
2
 
3
3
  Babel helpers are copied in there to properly appear in sourcemap.
4
4
 
5
- - Last sync date: 12 January 2024
5
+ - Last sync date: 29 August 2026 (@babel/helpers 7.29.7)
6
6
 
7
7
  - Helpers file: https://github.com/babel/babel/blob/main/packages/babel-helpers/src/helpers.ts
8
8
  - Individual helpers: https://github.com/babel/babel/tree/main/packages/babel-helpers/src/helpers
@@ -0,0 +1,232 @@
1
+ import checkInRHS from "../checkInRHS/checkInRHS.js";
2
+ import setFunctionName from "../setFunctionName/setFunctionName.js";
3
+ import toPropertyKey from "../toPropertyKey/toPropertyKey.js";
4
+
5
+ /* eslint-disable */
6
+ export default function applyDecs2311(targetClass, classDecs, memberDecs, classDecsHaveThis, instanceBrand, parentClass) {
7
+ var symbolMetadata = Symbol.metadata || Symbol["for"]("Symbol.metadata");
8
+ var defineProperty = Object.defineProperty;
9
+ var create = Object.create;
10
+ var metadata;
11
+ var existingNonFields = [create(null), create(null)];
12
+ var hasClassDecs = classDecs.length;
13
+ var _;
14
+ function createRunInitializers(initializers, useStaticThis, hasValue) {
15
+ return function (thisArg, value) {
16
+ if (useStaticThis) {
17
+ value = thisArg;
18
+ thisArg = targetClass;
19
+ }
20
+ for (var i = 0; i < initializers.length; i++) {
21
+ value = initializers[i].apply(thisArg, hasValue ? [value] : []);
22
+ }
23
+ return hasValue ? value : thisArg;
24
+ };
25
+ }
26
+ function assertCallable(fn, hint1, hint2, throwUndefined) {
27
+ if (typeof fn !== "function") {
28
+ if (throwUndefined || fn !== void 0) {
29
+ throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined"));
30
+ }
31
+ }
32
+ return fn;
33
+ }
34
+ function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, initializers, ret, isStatic, isPrivate, isField, hasPrivateBrand) {
35
+ function assertInstanceIfPrivate(target) {
36
+ if (!hasPrivateBrand(target)) {
37
+ throw new TypeError("Attempted to access private element on non-instance");
38
+ }
39
+ }
40
+ var decs = [].concat(decInfo[0]),
41
+ decVal = decInfo[3],
42
+ isClass = !ret;
43
+ var isAccessor = kind === 1;
44
+ var isGetter = kind === 3;
45
+ var isSetter = kind === 4;
46
+ var isMethod = kind === 2;
47
+ function _bindPropCall(name, useStaticThis, before) {
48
+ return function (_this, value) {
49
+ if (useStaticThis) {
50
+ value = _this;
51
+ _this = Class;
52
+ }
53
+ if (before) {
54
+ before(_this);
55
+ }
56
+ return desc[name].call(_this, value);
57
+ };
58
+ }
59
+ if (!isClass) {
60
+ var desc = {},
61
+ init = [],
62
+ key = isGetter ? "get" : isSetter || isAccessor ? "set" : "value";
63
+ if (isPrivate) {
64
+ if (isField || isAccessor) {
65
+ desc = {
66
+ get: setFunctionName(function () {
67
+ return decVal(this);
68
+ }, name, "get"),
69
+ set: function (value) {
70
+ decInfo[4](this, value);
71
+ }
72
+ };
73
+ } else {
74
+ desc[key] = decVal;
75
+ }
76
+ if (!isField) {
77
+ setFunctionName(desc[key], name, isMethod ? "" : key);
78
+ }
79
+ } else if (!isField) {
80
+ desc = Object.getOwnPropertyDescriptor(Class, name);
81
+ }
82
+ if (!isField && !isPrivate) {
83
+ _ = existingNonFields[+isStatic][name];
84
+ if (_ && (_ ^ kind) !== 7) {
85
+ throw new Error("Decorating two elements with the same name (" + desc[key].name + ") is not supported yet");
86
+ }
87
+ existingNonFields[+isStatic][name] = kind < 3 ? 1 : kind;
88
+ }
89
+ }
90
+ var newValue = Class;
91
+ for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {
92
+ var dec = assertCallable(decs[i], "A decorator", "be", true),
93
+ decThis = decoratorsHaveThis ? decs[i - 1] : void 0;
94
+ var decoratorFinishedRef = {};
95
+ var ctx = {
96
+ kind: ["field", "accessor", "method", "getter", "setter", "class"][kind],
97
+ name: name,
98
+ metadata: metadata,
99
+ addInitializer: function (decoratorFinishedRef, initializer) {
100
+ if (decoratorFinishedRef.v) {
101
+ throw new TypeError("attempted to call addInitializer after decoration was finished");
102
+ }
103
+ assertCallable(initializer, "An initializer", "be", true);
104
+ initializers.push(initializer);
105
+ }.bind(null, decoratorFinishedRef)
106
+ };
107
+ if (isClass) {
108
+ _ = dec.call(decThis, newValue, ctx);
109
+ decoratorFinishedRef.v = 1;
110
+ if (assertCallable(_, "class decorators", "return")) {
111
+ newValue = _;
112
+ }
113
+ } else {
114
+ ctx["static"] = isStatic;
115
+ ctx["private"] = isPrivate;
116
+ _ = ctx.access = {
117
+ has: isPrivate ? hasPrivateBrand.bind() : function (target) {
118
+ return name in target;
119
+ }
120
+ };
121
+ if (!isSetter) {
122
+ _.get = isPrivate ? isMethod ? function (_this) {
123
+ assertInstanceIfPrivate(_this);
124
+ return desc.value;
125
+ } : _bindPropCall("get", 0, assertInstanceIfPrivate) : function (target) {
126
+ return target[name];
127
+ };
128
+ }
129
+ if (!isMethod && !isGetter) {
130
+ _.set = isPrivate ? _bindPropCall("set", 0, assertInstanceIfPrivate) : function (target, v) {
131
+ target[name] = v;
132
+ };
133
+ }
134
+ newValue = dec.call(decThis, isAccessor ? {
135
+ get: desc.get,
136
+ set: desc.set
137
+ } : desc[key], ctx);
138
+ decoratorFinishedRef.v = 1;
139
+ if (isAccessor) {
140
+ if (typeof newValue === "object" && newValue) {
141
+ if (_ = assertCallable(newValue.get, "accessor.get")) {
142
+ desc.get = _;
143
+ }
144
+ if (_ = assertCallable(newValue.set, "accessor.set")) {
145
+ desc.set = _;
146
+ }
147
+ if (_ = assertCallable(newValue.init, "accessor.init")) {
148
+ init.unshift(_);
149
+ }
150
+ } else if (newValue !== void 0) {
151
+ throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined");
152
+ }
153
+ } else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) {
154
+ if (isField) {
155
+ init.unshift(newValue);
156
+ } else {
157
+ desc[key] = newValue;
158
+ }
159
+ }
160
+ }
161
+ }
162
+ if (kind < 2) {
163
+ ret.push(createRunInitializers(init, isStatic, 1), createRunInitializers(initializers, isStatic, 0));
164
+ }
165
+ if (!isField && !isClass) {
166
+ if (isPrivate) {
167
+ if (isAccessor) {
168
+ ret.splice(-1, 0, _bindPropCall("get", isStatic), _bindPropCall("set", isStatic));
169
+ } else {
170
+ ret.push(isMethod ? desc[key] : assertCallable.call.bind(desc[key]));
171
+ }
172
+ } else {
173
+ defineProperty(Class, name, desc);
174
+ }
175
+ }
176
+ return newValue;
177
+ }
178
+ function applyMemberDecs() {
179
+ var ret = [];
180
+ var protoInitializers;
181
+ var staticInitializers;
182
+ var pushInitializers = function (initializers) {
183
+ if (initializers) {
184
+ ret.push(createRunInitializers(initializers));
185
+ }
186
+ };
187
+ var applyMemberDecsOfKind = function (isStatic, isField) {
188
+ for (var i = 0; i < memberDecs.length; i++) {
189
+ var decInfo = memberDecs[i];
190
+ var kind = decInfo[1];
191
+ var kindOnly = kind & 7;
192
+ if ((kind & 8) == isStatic && !kindOnly == isField) {
193
+ var name = decInfo[2];
194
+ var isPrivate = !!decInfo[3];
195
+ var decoratorsHaveThis = kind & 16;
196
+ applyDec(isStatic ? targetClass : targetClass.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : toPropertyKey(name), kindOnly, kindOnly < 2 ? [] : isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, !!isStatic, isPrivate, isField, isStatic && isPrivate ? function (_) {
197
+ return checkInRHS(_) === targetClass;
198
+ } : instanceBrand);
199
+ }
200
+ }
201
+ };
202
+ applyMemberDecsOfKind(8, 0);
203
+ applyMemberDecsOfKind(0, 0);
204
+ applyMemberDecsOfKind(8, 1);
205
+ applyMemberDecsOfKind(0, 1);
206
+ pushInitializers(protoInitializers);
207
+ pushInitializers(staticInitializers);
208
+ return ret;
209
+ }
210
+ function defineMetadata(Class) {
211
+ return defineProperty(Class, symbolMetadata, {
212
+ configurable: true,
213
+ enumerable: true,
214
+ value: metadata
215
+ });
216
+ }
217
+ if (parentClass !== undefined) {
218
+ metadata = parentClass[symbolMetadata];
219
+ }
220
+ metadata = create(metadata == null ? null : metadata);
221
+ _ = applyMemberDecs();
222
+ if (!hasClassDecs) defineMetadata(targetClass);
223
+ return {
224
+ e: _,
225
+ get c() {
226
+ var initializers = [];
227
+ return hasClassDecs && [defineMetadata(targetClass = applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, initializers)), createRunInitializers(initializers, 1)];
228
+ }
229
+ };
230
+ }
231
+
232
+ //# sourceMappingURL=applyDecs2311.js.map
@@ -0,0 +1,9 @@
1
+ /* eslint-disable */
2
+ export default function _assertClassBrand(brand, receiver, returnValue) {
3
+ if (typeof brand === "function" ? brand === receiver : brand.has(receiver)) {
4
+ return arguments.length < 3 ? receiver : returnValue;
5
+ }
6
+ throw new TypeError("Private element is not present on this object");
7
+ }
8
+
9
+ //# sourceMappingURL=assertClassBrand.js.map
@@ -0,0 +1,8 @@
1
+ /* eslint-disable */
2
+ export default function _checkPrivateRedeclaration(obj, privateCollection) {
3
+ if (privateCollection.has(obj)) {
4
+ throw new TypeError("Cannot initialize the same private elements twice on an object");
5
+ }
6
+ }
7
+
8
+ //# sourceMappingURL=checkPrivateRedeclaration.js.map
@@ -0,0 +1,8 @@
1
+ import assertClassBrand from "../assertClassBrand/assertClassBrand.js";
2
+
3
+ /* eslint-disable */
4
+ export default function _classPrivateFieldGet2(privateMap, receiver) {
5
+ return privateMap.get(assertClassBrand(privateMap, receiver));
6
+ }
7
+
8
+ //# sourceMappingURL=classPrivateFieldGet2.js.map
@@ -0,0 +1,9 @@
1
+ import checkPrivateRedeclaration from "../checkPrivateRedeclaration/checkPrivateRedeclaration.js";
2
+
3
+ /* eslint-disable */
4
+ export default function _classPrivateFieldInitSpec(obj, privateMap, value) {
5
+ checkPrivateRedeclaration(obj, privateMap);
6
+ privateMap.set(obj, value);
7
+ }
8
+
9
+ //# sourceMappingURL=classPrivateFieldInitSpec.js.map
@@ -0,0 +1,9 @@
1
+ import assertClassBrand from "../assertClassBrand/assertClassBrand.js";
2
+
3
+ /* eslint-disable */
4
+ export default function _classPrivateFieldSet2(privateMap, receiver, value) {
5
+ privateMap.set(assertClassBrand(privateMap, receiver), value);
6
+ return value;
7
+ }
8
+
9
+ //# sourceMappingURL=classPrivateFieldSet2.js.map
@@ -0,0 +1,8 @@
1
+ import assertClassBrand from "../assertClassBrand/assertClassBrand.js";
2
+
3
+ /* eslint-disable */
4
+ export default function _classPrivateGetter(privateMap, receiver, getter) {
5
+ return getter(assertClassBrand(privateMap, receiver));
6
+ }
7
+
8
+ //# sourceMappingURL=classPrivateGetter.js.map
@@ -0,0 +1,9 @@
1
+ import checkPrivateRedeclaration from "../checkPrivateRedeclaration/checkPrivateRedeclaration.js";
2
+
3
+ /* eslint-disable */
4
+ export default function _classPrivateMethodInitSpec(obj, privateSet) {
5
+ checkPrivateRedeclaration(obj, privateSet);
6
+ privateSet.add(obj);
7
+ }
8
+
9
+ //# sourceMappingURL=classPrivateMethodInitSpec.js.map
@@ -0,0 +1,9 @@
1
+ import assertClassBrand from "../assertClassBrand/assertClassBrand.js";
2
+
3
+ /* eslint-disable */
4
+ export default function _classPrivateSetter(privateMap, setter, receiver, value) {
5
+ setter(assertClassBrand(privateMap, receiver), value);
6
+ return value;
7
+ }
8
+
9
+ //# sourceMappingURL=classPrivateSetter.js.map
@@ -0,0 +1,10 @@
1
+ import classApplyDescriptorDestructureSet from "../classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js";
2
+ import assertClassBrand from "../assertClassBrand/assertClassBrand.js";
3
+ import classCheckPrivateStaticFieldDescriptor from "../classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js";
4
+
5
+ /* eslint-disable */
6
+ export default function _classStaticPrivateFieldDestructureSet(receiver, classConstructor, descriptor) {
7
+ assertClassBrand(classConstructor, receiver);
8
+ classCheckPrivateStaticFieldDescriptor(descriptor, "set");
9
+ return classApplyDescriptorDestructureSet(receiver, descriptor);
10
+ }
@@ -0,0 +1,182 @@
1
+ import regeneratorDefine from "../regeneratorDefine/regeneratorDefine.js";
2
+
3
+ /* eslint-disable */
4
+ export default function _regenerator() {
5
+ var undefined;
6
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
7
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
8
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
9
+ var _;
10
+ function wrap(innerFn, outerFn, self, tryLocsList) {
11
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
12
+ var generator = Object.create(protoGenerator.prototype);
13
+ regeneratorDefine(generator, "_invoke", makeInvokeMethod(innerFn, self, tryLocsList), true);
14
+ return generator;
15
+ }
16
+ var ContinueSentinel = {};
17
+ function Generator() {}
18
+ function GeneratorFunction() {}
19
+ function GeneratorFunctionPrototype() {}
20
+ _ = Object.getPrototypeOf;
21
+ var IteratorPrototype = [][iteratorSymbol] ? _(_([][iteratorSymbol]())) : (regeneratorDefine(_ = {}, iteratorSymbol, function () {
22
+ return this;
23
+ }), _);
24
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
25
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
26
+ regeneratorDefine(Gp, "constructor", GeneratorFunctionPrototype);
27
+ regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
28
+ GeneratorFunction.displayName = "GeneratorFunction";
29
+ regeneratorDefine(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
30
+ regeneratorDefine(Gp);
31
+ regeneratorDefine(Gp, toStringTagSymbol, "Generator");
32
+ regeneratorDefine(Gp, iteratorSymbol, function () {
33
+ return this;
34
+ });
35
+ regeneratorDefine(Gp, "toString", function () {
36
+ return "[object Generator]";
37
+ });
38
+ function mark(genFun) {
39
+ if (Object.setPrototypeOf) {
40
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
41
+ } else {
42
+ genFun.__proto__ = GeneratorFunctionPrototype;
43
+ regeneratorDefine(genFun, toStringTagSymbol, "GeneratorFunction");
44
+ }
45
+ genFun.prototype = Object.create(Gp);
46
+ return genFun;
47
+ }
48
+ function makeInvokeMethod(innerFn, self, tryLocsList) {
49
+ var state = 0;
50
+ function invoke(_methodName, _method, _arg) {
51
+ if (state > 1) {
52
+ throw TypeError("Generator is already running");
53
+ } else if (done) {
54
+ if (_method === 1) {
55
+ Context_dispatchExceptionOrFinishOrAbrupt(_method, _arg);
56
+ }
57
+ }
58
+ method = _method;
59
+ arg = _arg;
60
+ while ((_ = method < 2 ? undefined : arg) || !done) {
61
+ if (!delegateIterator) {
62
+ if (!method) {
63
+ ctx.v = arg;
64
+ } else if (method < 3) {
65
+ if (method > 1) ctx.n = -1;
66
+ Context_dispatchExceptionOrFinishOrAbrupt(method, arg);
67
+ } else {
68
+ ctx.n = arg;
69
+ }
70
+ }
71
+ try {
72
+ state = 2;
73
+ if (delegateIterator) {
74
+ if (!method) _methodName = "next";
75
+ if (_ = delegateIterator[_methodName]) {
76
+ if (!(_ = _.call(delegateIterator, arg))) {
77
+ throw TypeError("iterator result is not an object");
78
+ }
79
+ if (!_.done) {
80
+ return _;
81
+ }
82
+ arg = _.value;
83
+ if (method < 2) {
84
+ method = 0;
85
+ }
86
+ } else {
87
+ if (method === 1 && (_ = delegateIterator["return"])) {
88
+ _.call(delegateIterator);
89
+ }
90
+ if (method < 2) {
91
+ arg = TypeError("The iterator does not provide a '" + _methodName + "' method");
92
+ method = 1;
93
+ }
94
+ }
95
+ delegateIterator = undefined;
96
+ } else {
97
+ if (done = ctx.n < 0) {
98
+ _ = arg;
99
+ } else {
100
+ _ = innerFn.call(self, ctx);
101
+ }
102
+ if (_ !== ContinueSentinel) {
103
+ break;
104
+ }
105
+ }
106
+ } catch (e) {
107
+ delegateIterator = undefined;
108
+ method = 1;
109
+ arg = e;
110
+ } finally {
111
+ state = 1;
112
+ }
113
+ }
114
+ return {
115
+ value: _,
116
+ done: done
117
+ };
118
+ }
119
+ var tryEntries = tryLocsList || [];
120
+ var done = false;
121
+ var delegateIterator;
122
+ var method;
123
+ var arg;
124
+ var ctx = {
125
+ p: 0,
126
+ n: 0,
127
+ v: undefined,
128
+ a: Context_dispatchExceptionOrFinishOrAbrupt,
129
+ f: Context_dispatchExceptionOrFinishOrAbrupt.bind(undefined, 4),
130
+ d: function (iterable, nextLoc) {
131
+ delegateIterator = iterable;
132
+ method = 0;
133
+ arg = undefined;
134
+ ctx.n = nextLoc;
135
+ return ContinueSentinel;
136
+ }
137
+ };
138
+ function Context_dispatchExceptionOrFinishOrAbrupt(_type, _arg) {
139
+ method = _type;
140
+ arg = _arg;
141
+ for (_ = 0; !done && state && !shouldReturn && _ < tryEntries.length; _++) {
142
+ var entry = tryEntries[_];
143
+ var prev = ctx.p;
144
+ var finallyLoc = entry[2];
145
+ var shouldReturn;
146
+ if (_type > 3) {
147
+ if (shouldReturn = finallyLoc === _arg) {
148
+ arg = entry[(method = entry[4]) ? 5 : (method = 3, 3)];
149
+ entry[4] = entry[5] = undefined;
150
+ }
151
+ } else {
152
+ if (entry[0] <= prev) {
153
+ if (shouldReturn = _type < 2 && prev < entry[1]) {
154
+ method = 0;
155
+ ctx.v = _arg;
156
+ ctx.n = entry[1];
157
+ } else if (prev < finallyLoc) {
158
+ if (shouldReturn = _type < 3 || entry[0] > _arg || _arg > finallyLoc) {
159
+ entry[4] = _type;
160
+ entry[5] = _arg;
161
+ ctx.n = finallyLoc;
162
+ method = 0;
163
+ }
164
+ }
165
+ }
166
+ }
167
+ }
168
+ if (shouldReturn || _type > 1) {
169
+ return ContinueSentinel;
170
+ }
171
+ done = true;
172
+ throw _arg;
173
+ }
174
+ return invoke;
175
+ }
176
+ return (_regenerator = function () {
177
+ return {
178
+ w: wrap,
179
+ m: mark
180
+ };
181
+ })();
182
+ }
@@ -0,0 +1,9 @@
1
+ import regeneratorAsyncGen from "../regeneratorAsyncGen/regeneratorAsyncGen.js";
2
+
3
+ /* eslint-disable */
4
+ export default function _regeneratorAsync(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
5
+ var iter = regeneratorAsyncGen(innerFn, outerFn, self, tryLocsList, PromiseImpl);
6
+ return iter.next().then(function (result) {
7
+ return result.done ? result.value : iter.next();
8
+ });
9
+ }
@@ -0,0 +1,7 @@
1
+ import regenerator from "../regenerator/regenerator.js";
2
+ import regeneratorAsyncIterator from "../regeneratorAsyncIterator/regeneratorAsyncIterator.js";
3
+
4
+ /* eslint-disable */
5
+ export default function _regeneratorAsyncGen(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
6
+ return new regeneratorAsyncIterator(regenerator().w(innerFn, outerFn, self, tryLocsList), PromiseImpl || Promise);
7
+ }
@@ -0,0 +1,43 @@
1
+ import OverloadYield from "../OverloadYield/OverloadYield.js";
2
+ import regeneratorDefine from "../regeneratorDefine/regeneratorDefine.js";
3
+
4
+ /* eslint-disable */
5
+ export default function AsyncIterator(generator, PromiseImpl) {
6
+ if (!this.next) {
7
+ regeneratorDefine(AsyncIterator.prototype);
8
+ regeneratorDefine(AsyncIterator.prototype, typeof Symbol === "function" && Symbol.asyncIterator || "@asyncIterator", function () {
9
+ return this;
10
+ });
11
+ }
12
+ function invoke(method, arg, resolve, reject) {
13
+ try {
14
+ var result = generator[method](arg);
15
+ var value = result.value;
16
+ if (value instanceof OverloadYield) {
17
+ return PromiseImpl.resolve(value.v).then(function (value) {
18
+ invoke("next", value, resolve, reject);
19
+ }, function (err) {
20
+ invoke("throw", err, resolve, reject);
21
+ });
22
+ }
23
+ return PromiseImpl.resolve(value).then(function (unwrapped) {
24
+ result.value = unwrapped;
25
+ resolve(result);
26
+ }, function (error) {
27
+ return invoke("throw", error, resolve, reject);
28
+ });
29
+ } catch (error) {
30
+ reject(error);
31
+ }
32
+ }
33
+ var previousPromise;
34
+ function enqueue(method, i, arg) {
35
+ function callInvokeWithMethodAndArg() {
36
+ return new PromiseImpl(function (resolve, reject) {
37
+ invoke(method, arg, resolve, reject);
38
+ });
39
+ }
40
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
41
+ }
42
+ regeneratorDefine(this, "_invoke", enqueue, true);
43
+ }
@@ -0,0 +1,33 @@
1
+ /* eslint-disable */
2
+ export default function regeneratorDefine(obj, key, value, noFlags) {
3
+ var define = Object.defineProperty;
4
+ try {
5
+ define({}, "", {});
6
+ } catch (_) {
7
+ define = 0;
8
+ }
9
+ regeneratorDefine = function (obj, key, value, noFlags) {
10
+ function defineIteratorMethod(method, i) {
11
+ regeneratorDefine(obj, method, function (arg) {
12
+ return this._invoke(method, i, arg);
13
+ });
14
+ }
15
+ if (!key) {
16
+ defineIteratorMethod("next", 0);
17
+ defineIteratorMethod("throw", 1);
18
+ defineIteratorMethod("return", 2);
19
+ } else {
20
+ if (define) {
21
+ define(obj, key, {
22
+ value: value,
23
+ enumerable: !noFlags,
24
+ configurable: !noFlags,
25
+ writable: !noFlags
26
+ });
27
+ } else {
28
+ obj[key] = value;
29
+ }
30
+ }
31
+ };
32
+ regeneratorDefine(obj, key, value, noFlags);
33
+ }
@@ -0,0 +1,21 @@
1
+ /* eslint-disable */
2
+ export default function _regeneratorKeys(val) {
3
+ var object = Object(val);
4
+ var keys = [];
5
+ var key;
6
+ for (var key in object) {
7
+ keys.unshift(key);
8
+ }
9
+ return function next() {
10
+ while (keys.length) {
11
+ key = keys.pop();
12
+ if (key in object) {
13
+ next.value = key;
14
+ next.done = false;
15
+ return next;
16
+ }
17
+ }
18
+ next.done = true;
19
+ return next;
20
+ };
21
+ }
@@ -0,0 +1,25 @@
1
+ /* eslint-disable */
2
+ export default function _regeneratorValues(iterable) {
3
+ if (iterable != null) {
4
+ var iteratorMethod = iterable[typeof Symbol === "function" && Symbol.iterator || "@@iterator"],
5
+ i = 0;
6
+ if (iteratorMethod) {
7
+ return iteratorMethod.call(iterable);
8
+ }
9
+ if (typeof iterable.next === "function") {
10
+ return iterable;
11
+ }
12
+ if (!isNaN(iterable.length)) {
13
+ return {
14
+ next: function () {
15
+ if (iterable && i >= iterable.length) iterable = undefined;
16
+ return {
17
+ value: iterable && iterable[i++],
18
+ done: !iterable
19
+ };
20
+ }
21
+ };
22
+ }
23
+ }
24
+ throw new TypeError(typeof iterable + " is not iterable");
25
+ }
@@ -0,0 +1,10 @@
1
+ import get from "../get/get.js";
2
+ import getPrototypeOf from "../getPrototypeOf/getPrototypeOf.js";
3
+
4
+ /* eslint-disable */
5
+ export default function _superPropGet(classArg, property, receiver, flags) {
6
+ var result = get(getPrototypeOf(flags & 1 ? classArg.prototype : classArg), property, receiver);
7
+ return flags & 2 && typeof result === "function" ? function (args) {
8
+ return result.apply(receiver, args);
9
+ } : result;
10
+ }
@@ -0,0 +1,7 @@
1
+ import set from "../set/set.js";
2
+ import getPrototypeOf from "../getPrototypeOf/getPrototypeOf.js";
3
+
4
+ /* eslint-disable */
5
+ export default function _superPropSet(classArg, property, value, receiver, isStrict, prototype) {
6
+ return set(getPrototypeOf(prototype ? classArg.prototype : classArg), property, value, receiver, isStrict);
7
+ }
@@ -0,0 +1,11 @@
1
+ /* eslint-disable */
2
+ export default function _toSetter(fn, args, thisArg) {
3
+ if (!args) args = [];
4
+ var l = args.length++;
5
+ return Object.defineProperty({}, "_", {
6
+ set: function (v) {
7
+ args[l] = v;
8
+ fn.apply(thisArg, args);
9
+ }
10
+ });
11
+ }
@@ -0,0 +1,9 @@
1
+ /* eslint-disable */
2
+ export default function tsRewriteRelativeImportExtensions(path, preserveJsx) {
3
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
4
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
5
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
6
+ });
7
+ }
8
+ return path;
9
+ }
@@ -0,0 +1,96 @@
1
+ /* eslint-disable */
2
+ export default function _usingCtx() {
3
+ var _disposeSuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed) {
4
+ var err = new Error();
5
+ err.name = "SuppressedError";
6
+ err.error = error;
7
+ err.suppressed = suppressed;
8
+ return err;
9
+ },
10
+ empty = {},
11
+ stack = [];
12
+ function using(isAwait, value) {
13
+ if (value != null) {
14
+ if (Object(value) !== value) {
15
+ throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
16
+ }
17
+ if (isAwait) {
18
+ var dispose = value[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
19
+ }
20
+ if (dispose === undefined) {
21
+ dispose = value[Symbol.dispose || Symbol["for"]("Symbol.dispose")];
22
+ if (isAwait) {
23
+ var inner = dispose;
24
+ }
25
+ }
26
+ if (typeof dispose !== "function") {
27
+ throw new TypeError("Object is not disposable.");
28
+ }
29
+ if (inner) {
30
+ dispose = function () {
31
+ try {
32
+ inner.call(value);
33
+ } catch (e) {
34
+ return Promise.reject(e);
35
+ }
36
+ };
37
+ }
38
+ stack.push({
39
+ v: value,
40
+ d: dispose,
41
+ a: isAwait
42
+ });
43
+ } else if (isAwait) {
44
+ stack.push({
45
+ d: value,
46
+ a: isAwait
47
+ });
48
+ }
49
+ return value;
50
+ }
51
+ return {
52
+ e: empty,
53
+ u: using.bind(null, false),
54
+ a: using.bind(null, true),
55
+ d: function () {
56
+ var error = this.e,
57
+ state = 0,
58
+ resource;
59
+ function next() {
60
+ while (resource = stack.pop()) {
61
+ try {
62
+ if (!resource.a && state === 1) {
63
+ state = 0;
64
+ stack.push(resource);
65
+ return Promise.resolve().then(next);
66
+ }
67
+ if (resource.d) {
68
+ var disposalResult = resource.d.call(resource.v);
69
+ if (resource.a) {
70
+ state |= 2;
71
+ return Promise.resolve(disposalResult).then(next, err);
72
+ }
73
+ } else {
74
+ state |= 1;
75
+ }
76
+ } catch (e) {
77
+ return err(e);
78
+ }
79
+ }
80
+ if (state === 1) {
81
+ if (error !== empty) {
82
+ return Promise.reject(error);
83
+ } else {
84
+ return Promise.resolve();
85
+ }
86
+ }
87
+ if (error !== empty) throw error;
88
+ }
89
+ function err(e) {
90
+ error = error !== empty ? new _disposeSuppressedError(e, error) : e;
91
+ return next();
92
+ }
93
+ return next();
94
+ }
95
+ };
96
+ }
@@ -15,7 +15,7 @@ export const babelPluginCompatMap = {
15
15
  firefox: "70",
16
16
  safari: "13",
17
17
  node: "12.5",
18
- ios: "13",
18
+ ios_safari: "13",
19
19
  samsung: "11",
20
20
  electron: "6",
21
21
  },
@@ -36,6 +36,7 @@ export const babelPluginCompatMap = {
36
36
  edge: "80",
37
37
  firefox: "72",
38
38
  safari: "13.1",
39
+ ios_safari: "13.4",
39
40
  node: "14",
40
41
  electron: "8.1",
41
42
  },
@@ -45,6 +46,7 @@ export const babelPluginCompatMap = {
45
46
  edge: "80",
46
47
  firefox: "74",
47
48
  safari: "13.1",
49
+ ios_safari: "13.4",
48
50
  node: "14",
49
51
  electron: "8.1",
50
52
  },
@@ -55,7 +57,7 @@ export const babelPluginCompatMap = {
55
57
  firefox: "62",
56
58
  safari: "12",
57
59
  node: "10",
58
- ios: "12",
60
+ ios_safari: "12",
59
61
  samsung: "9",
60
62
  electron: "3",
61
63
  },
@@ -66,7 +68,7 @@ export const babelPluginCompatMap = {
66
68
  firefox: "58",
67
69
  safari: "11.1",
68
70
  node: "10",
69
- ios: "11.3",
71
+ ios_safari: "11.3",
70
72
  samsung: "9",
71
73
  electron: "3",
72
74
  },
@@ -78,7 +80,7 @@ export const babelPluginCompatMap = {
78
80
  firefox: "53",
79
81
  safari: "10",
80
82
  node: "6",
81
- ios: "10",
83
+ ios_safari: "10",
82
84
  samsung: "5",
83
85
  electron: "0.37",
84
86
  },
@@ -89,7 +91,7 @@ export const babelPluginCompatMap = {
89
91
  firefox: "57",
90
92
  safari: "12",
91
93
  node: "10",
92
- ios: "12",
94
+ ios_safari: "12",
93
95
  samsung: "8",
94
96
  electron: "3",
95
97
  },
@@ -100,7 +102,7 @@ export const babelPluginCompatMap = {
100
102
  firefox: "55",
101
103
  safari: "11.1",
102
104
  node: "8.3",
103
- ios: "11.3",
105
+ ios_safari: "11.3",
104
106
  samsung: "8",
105
107
  electron: "2",
106
108
  },
@@ -111,7 +113,7 @@ export const babelPluginCompatMap = {
111
113
  firefox: "78",
112
114
  safari: "11.1",
113
115
  node: "8.10",
114
- ios: "11.3",
116
+ ios_safari: "11.3",
115
117
  samsung: "8",
116
118
  electron: "3",
117
119
  },
@@ -122,7 +124,7 @@ export const babelPluginCompatMap = {
122
124
  firefox: "78",
123
125
  safari: "11.1",
124
126
  node: "10",
125
- ios: "11.3",
127
+ ios_safari: "11.3",
126
128
  samsung: "9",
127
129
  electron: "3",
128
130
  },
@@ -132,7 +134,7 @@ export const babelPluginCompatMap = {
132
134
  edge: "79",
133
135
  safari: "11.1",
134
136
  node: "10",
135
- ios: "11.3",
137
+ ios_safari: "11.3",
136
138
  samsung: "9",
137
139
  electron: "3",
138
140
  },
@@ -143,7 +145,7 @@ export const babelPluginCompatMap = {
143
145
  firefox: "52",
144
146
  safari: "11",
145
147
  node: "7.6",
146
- ios: "11",
148
+ ios_safari: "11",
147
149
  samsung: "6",
148
150
  electron: "1.6",
149
151
  },
@@ -154,7 +156,7 @@ export const babelPluginCompatMap = {
154
156
  firefox: "52",
155
157
  safari: "10.1",
156
158
  node: "7",
157
- ios: "10.3",
159
+ ios_safari: "10.3",
158
160
  samsung: "6",
159
161
  electron: "1.3",
160
162
  },
@@ -166,7 +168,7 @@ export const babelPluginCompatMap = {
166
168
  firefox: "34",
167
169
  safari: "13",
168
170
  node: "4",
169
- ios: "13",
171
+ ios_safari: "13",
170
172
  samsung: "3.4",
171
173
  },
172
174
  "transform-literals": {
@@ -176,7 +178,7 @@ export const babelPluginCompatMap = {
176
178
  firefox: "53",
177
179
  safari: "9",
178
180
  node: "4",
179
- ios: "9",
181
+ ios_safari: "9",
180
182
  samsung: "4",
181
183
  electron: "0.30",
182
184
  },
@@ -187,7 +189,7 @@ export const babelPluginCompatMap = {
187
189
  firefox: "53",
188
190
  safari: "10",
189
191
  node: "6.5",
190
- ios: "10",
192
+ ios_safari: "10",
191
193
  samsung: "5",
192
194
  electron: "1.2",
193
195
  },
@@ -198,7 +200,7 @@ export const babelPluginCompatMap = {
198
200
  firefox: "45",
199
201
  safari: "10",
200
202
  node: "6",
201
- ios: "10",
203
+ ios_safari: "10",
202
204
  samsung: "5",
203
205
  electron: "0.36",
204
206
  },
@@ -210,7 +212,7 @@ export const babelPluginCompatMap = {
210
212
  safari: "10",
211
213
  node: "4",
212
214
  ie: "11",
213
- ios: "10",
215
+ ios_safari: "10",
214
216
  samsung: "3.4",
215
217
  electron: "0.22",
216
218
  },
@@ -221,7 +223,7 @@ export const babelPluginCompatMap = {
221
223
  firefox: "45",
222
224
  safari: "10",
223
225
  node: "5",
224
- ios: "10",
226
+ ios_safari: "10",
225
227
  samsung: "5",
226
228
  electron: "0.36",
227
229
  },
@@ -232,7 +234,7 @@ export const babelPluginCompatMap = {
232
234
  firefox: "45",
233
235
  safari: "10",
234
236
  node: "5",
235
- ios: "10",
237
+ ios_safari: "10",
236
238
  samsung: "5",
237
239
  electron: "0.36",
238
240
  },
@@ -243,7 +245,7 @@ export const babelPluginCompatMap = {
243
245
  firefox: "33",
244
246
  safari: "9",
245
247
  node: "4",
246
- ios: "9",
248
+ ios_safari: "9",
247
249
  samsung: "4",
248
250
  electron: "0.28",
249
251
  },
@@ -254,7 +256,7 @@ export const babelPluginCompatMap = {
254
256
  firefox: "34",
255
257
  safari: "9",
256
258
  node: "4",
257
- ios: "9",
259
+ ios_safari: "9",
258
260
  samsung: "3.4",
259
261
  electron: "0.25",
260
262
  },
@@ -265,7 +267,7 @@ export const babelPluginCompatMap = {
265
267
  firefox: "34",
266
268
  safari: "7.1",
267
269
  node: "4",
268
- ios: "8",
270
+ ios_safari: "8",
269
271
  samsung: "4",
270
272
  electron: "0.30",
271
273
  },
@@ -276,7 +278,7 @@ export const babelPluginCompatMap = {
276
278
  firefox: "53",
277
279
  safari: "10",
278
280
  node: "6.5",
279
- ios: "10",
281
+ ios_safari: "10",
280
282
  samsung: "5",
281
283
  electron: "1.2",
282
284
  },
@@ -287,7 +289,7 @@ export const babelPluginCompatMap = {
287
289
  firefox: "3",
288
290
  safari: "10",
289
291
  node: "6",
290
- ios: "10",
292
+ ios_safari: "10",
291
293
  samsung: "5",
292
294
  electron: "0.37",
293
295
  },
@@ -298,7 +300,7 @@ export const babelPluginCompatMap = {
298
300
  firefox: "53",
299
301
  safari: "9",
300
302
  node: "4",
301
- ios: "9",
303
+ ios_safari: "9",
302
304
  samsung: "4",
303
305
  electron: "0.30",
304
306
  },
@@ -309,7 +311,7 @@ export const babelPluginCompatMap = {
309
311
  firefox: "46",
310
312
  safari: "12",
311
313
  node: "6",
312
- ios: "12",
314
+ ios_safari: "12",
313
315
  samsung: "5",
314
316
  electron: "1.1",
315
317
  },
@@ -320,7 +322,7 @@ export const babelPluginCompatMap = {
320
322
  firefox: "36",
321
323
  safari: "10",
322
324
  node: "5",
323
- ios: "10",
325
+ ios_safari: "10",
324
326
  samsung: "5",
325
327
  electron: "0.36",
326
328
  },
@@ -331,7 +333,7 @@ export const babelPluginCompatMap = {
331
333
  firefox: "53",
332
334
  safari: "10",
333
335
  node: "6.5",
334
- ios: "10",
336
+ ios_safari: "10",
335
337
  samsung: "5",
336
338
  electron: "1.2",
337
339
  },
@@ -342,7 +344,7 @@ export const babelPluginCompatMap = {
342
344
  firefox: "51",
343
345
  safari: "11",
344
346
  node: "6",
345
- ios: "11",
347
+ ios_safari: "11",
346
348
  samsung: "5",
347
349
  electron: "0.37",
348
350
  },
@@ -353,7 +355,7 @@ export const babelPluginCompatMap = {
353
355
  firefox: "36",
354
356
  safari: "9",
355
357
  node: "0.12",
356
- ios: "9",
358
+ ios_safari: "9",
357
359
  samsung: "3",
358
360
  electron: "0.20",
359
361
  },
@@ -364,7 +366,7 @@ export const babelPluginCompatMap = {
364
366
  firefox: "41",
365
367
  safari: "10",
366
368
  node: "5",
367
- ios: "10",
369
+ ios_safari: "10",
368
370
  samsung: "5",
369
371
  electron: "0.36",
370
372
  },
@@ -375,7 +377,7 @@ export const babelPluginCompatMap = {
375
377
  firefox: "53",
376
378
  safari: "10",
377
379
  node: "6",
378
- ios: "10",
380
+ ios_safari: "10",
379
381
  samsung: "5",
380
382
  electron: "1.1",
381
383
  },
@@ -388,7 +390,7 @@ export const babelPluginCompatMap = {
388
390
  node: "0.10",
389
391
  ie: "9",
390
392
  android: "4",
391
- ios: "6",
393
+ ios_safari: "6",
392
394
  phantom: "2",
393
395
  samsung: "1",
394
396
  electron: "0.20",
@@ -402,7 +404,7 @@ export const babelPluginCompatMap = {
402
404
  node: "0.10",
403
405
  ie: "9",
404
406
  android: "4",
405
- ios: "6",
407
+ ios_safari: "6",
406
408
  phantom: "2",
407
409
  samsung: "1",
408
410
  electron: "0.20",
@@ -416,7 +418,7 @@ export const babelPluginCompatMap = {
416
418
  node: "0.10",
417
419
  ie: "9",
418
420
  android: "4.4",
419
- ios: "6",
421
+ ios_safari: "6",
420
422
  phantom: "2",
421
423
  samsung: "1",
422
424
  electron: "0.20",
@@ -82,6 +82,7 @@ export const jsenvPluginBabel = ({ babelHelpersAsImport = true } = {}) => {
82
82
  const { code, map } = await applyBabelPlugins({
83
83
  babelPlugins,
84
84
  options: {
85
+ sourceMaps: urlInfo.context.sourcemapsEnabled,
85
86
  generatorOpts: {
86
87
  retainLines: urlInfo.context.dev,
87
88
  },
@@ -21,12 +21,23 @@ export const applyCssTranspilation = async ({
21
21
  return { content: String(code), sourcemap: map };
22
22
  };
23
23
 
24
+ // runtimeCompat names on the left, lightningcss target names on the right
25
+ // (https://lightningcss.dev/transpilation.html#targets)
26
+ const LIGHTNINGCSS_TARGET_NAMES = {
27
+ chrome: "chrome",
28
+ firefox: "firefox",
29
+ ie: "ie",
30
+ ios_safari: "ios_saf",
31
+ opera: "opera",
32
+ safari: "safari",
33
+ };
34
+
24
35
  const runtimeCompatToTargets = (runtimeCompat) => {
25
36
  const targets = {};
26
- ["chrome", "firefox", "ie", "opera", "safari"].forEach((runtimeName) => {
37
+ Object.keys(LIGHTNINGCSS_TARGET_NAMES).forEach((runtimeName) => {
27
38
  const version = runtimeCompat[runtimeName];
28
39
  if (version) {
29
- targets[runtimeName] = versionToBits(version);
40
+ targets[LIGHTNINGCSS_TARGET_NAMES[runtimeName]] = versionToBits(version);
30
41
  }
31
42
  });
32
43
  return targets;
@@ -118,6 +118,7 @@ export const jsenvPluginJsModuleConversion = ({ remapImportSpecifier }) => {
118
118
  outputUrl: urlInfo.url,
119
119
  outputFormat,
120
120
  remapImportSpecifier,
121
+ generateSourcemap: urlInfo.context.sourcemapsEnabled,
121
122
  });
122
123
  return {
123
124
  content,
@@ -48,6 +48,7 @@ export const jsenvPluginTopLevelAwait = ({ needJsModuleFallback }) => {
48
48
  inputIsJsModule: true,
49
49
  inputUrl: urlInfo.originalUrl,
50
50
  outputUrl: urlInfo.generatedUrl,
51
+ options: { sourceMaps: urlInfo.context.sourcemapsEnabled },
51
52
  });
52
53
  return {
53
54
  content: code,