remove es20xx prefixes from plugins and rename folders (#6575)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
export function lazyLoadOperation () {
|
||||
return import('./x')
|
||||
.then(function (x) {
|
||||
x.y();
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
function lazyLoadOperation() {
|
||||
return _context.import('./x').then(function (x) {
|
||||
x.y();
|
||||
});
|
||||
}
|
||||
|
||||
_export("lazyLoadOperation", lazyLoadOperation);
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
3
packages/babel-plugin-transform-modules-systemjs/test/fixtures/dynamic-import/options.json
vendored
Normal file
3
packages/babel-plugin-transform-modules-systemjs/test/fixtures/dynamic-import/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["external-helpers", "syntax-dynamic-import", "transform-modules-systemjs"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const [foo, bar = 2] = [];
|
||||
@@ -0,0 +1,14 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const [foo, bar = 2] = [];
|
||||
|
||||
_export("foo", foo);
|
||||
|
||||
_export("bar", bar);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export const [foo, bar, ...baz] = [];
|
||||
@@ -0,0 +1,16 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const [foo, bar, ...baz] = [];
|
||||
|
||||
_export("foo", foo);
|
||||
|
||||
_export("bar", bar);
|
||||
|
||||
_export("baz", baz);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export const [foo, bar] = [];
|
||||
@@ -0,0 +1,14 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const [foo, bar] = [];
|
||||
|
||||
_export("foo", foo);
|
||||
|
||||
_export("bar", bar);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export const { foo: { bar: [baz, qux] } } = {};
|
||||
@@ -0,0 +1,18 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const {
|
||||
foo: {
|
||||
bar: [baz, qux]
|
||||
}
|
||||
} = {};
|
||||
|
||||
_export("baz", baz);
|
||||
|
||||
_export("qux", qux);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export const { foo, bar = 1 } = {};
|
||||
@@ -0,0 +1,17 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const {
|
||||
foo,
|
||||
bar = 1
|
||||
} = {};
|
||||
|
||||
_export("foo", foo);
|
||||
|
||||
_export("bar", bar);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export const { foo, ...bar } = {};
|
||||
@@ -0,0 +1,17 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const {
|
||||
foo,
|
||||
...bar
|
||||
} = {};
|
||||
|
||||
_export("foo", foo);
|
||||
|
||||
_export("bar", bar);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["external-helpers", "transform-modules-systemjs", "syntax-object-rest-spread"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const { foo: bar, baz } = {};
|
||||
@@ -0,0 +1,17 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const {
|
||||
foo: bar,
|
||||
baz
|
||||
} = {};
|
||||
|
||||
_export("bar", bar);
|
||||
|
||||
_export("baz", baz);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export default {};
|
||||
@@ -0,0 +1,10 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
_export("default", {});
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export default [];
|
||||
@@ -0,0 +1,10 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
_export("default", []);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export default foo;
|
||||
@@ -0,0 +1,10 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
_export("default", foo);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export default function () {}
|
||||
@@ -0,0 +1,10 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
_export("default", function () {});
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export default class {}
|
||||
@@ -0,0 +1,10 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
_export("default", class {});
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export default function foo () {}
|
||||
@@ -0,0 +1,12 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
function foo() {}
|
||||
|
||||
_export("default", foo);
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export default class Foo {}
|
||||
@@ -0,0 +1,12 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
class Foo {}
|
||||
|
||||
_export("default", Foo);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export default (function(){return "foo"})();
|
||||
@@ -0,0 +1,12 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
_export("default", function () {
|
||||
return "foo";
|
||||
}());
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export default 42;
|
||||
@@ -0,0 +1,10 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
_export("default", 42);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export {foo} from "foo";
|
||||
@@ -0,0 +1,13 @@
|
||||
System.register(["foo"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [function (_foo) {
|
||||
var _exportObj = {};
|
||||
_exportObj.foo = _foo.foo;
|
||||
|
||||
_export(_exportObj);
|
||||
}],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export {foo, bar} from "foo";
|
||||
@@ -0,0 +1,14 @@
|
||||
System.register(["foo"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [function (_foo) {
|
||||
var _exportObj = {};
|
||||
_exportObj.foo = _foo.foo;
|
||||
_exportObj.bar = _foo.bar;
|
||||
|
||||
_export(_exportObj);
|
||||
}],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export {foo as bar} from "foo";
|
||||
@@ -0,0 +1,13 @@
|
||||
System.register(["foo"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [function (_foo) {
|
||||
var _exportObj = {};
|
||||
_exportObj.bar = _foo.foo;
|
||||
|
||||
_export(_exportObj);
|
||||
}],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export {foo as default} from "foo";
|
||||
@@ -0,0 +1,13 @@
|
||||
System.register(["foo"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [function (_foo) {
|
||||
var _exportObj = {};
|
||||
_exportObj.default = _foo.foo;
|
||||
|
||||
_export(_exportObj);
|
||||
}],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export {foo as default, bar} from "foo";
|
||||
@@ -0,0 +1,14 @@
|
||||
System.register(["foo"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [function (_foo) {
|
||||
var _exportObj = {};
|
||||
_exportObj.default = _foo.foo;
|
||||
_exportObj.bar = _foo.bar;
|
||||
|
||||
_export(_exportObj);
|
||||
}],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export * from "foo";
|
||||
16
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from/expected.js
vendored
Normal file
16
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from/expected.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
System.register(["foo"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [function (_foo) {
|
||||
var _exportObj = {};
|
||||
|
||||
for (var _key in _foo) {
|
||||
if (_key !== "default" && _key !== "__esModule") _exportObj[_key] = _foo[_key];
|
||||
}
|
||||
|
||||
_export(_exportObj);
|
||||
}],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export {foo, bar};
|
||||
@@ -0,0 +1,12 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
_export("foo", foo);
|
||||
|
||||
_export("bar", bar);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export {foo as bar};
|
||||
@@ -0,0 +1,10 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
_export("bar", foo);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export {foo as default};
|
||||
@@ -0,0 +1,10 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
_export("default", foo);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export {foo as default, bar};
|
||||
@@ -0,0 +1,12 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
_export("default", foo);
|
||||
|
||||
_export("bar", bar);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export function foo() {}
|
||||
@@ -0,0 +1,12 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
function foo() {}
|
||||
|
||||
_export("foo", foo);
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export function foo2(bar) {}
|
||||
@@ -0,0 +1,12 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
function foo2(bar) {}
|
||||
|
||||
_export("foo2", foo2);
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export {foo};
|
||||
10
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named/expected.js
vendored
Normal file
10
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named/expected.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
_export("foo", foo);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
export var foo = 1;
|
||||
export var foo2 = function () {};
|
||||
export var foo3;
|
||||
export let foo4 = 2;
|
||||
export let foo5;
|
||||
export const foo6 = 3;
|
||||
export function foo7 () {}
|
||||
export class foo8 {}
|
||||
foo3 = 5;
|
||||
@@ -0,0 +1,42 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
var foo = 1;
|
||||
|
||||
_export("foo", foo);
|
||||
|
||||
var foo2 = function () {};
|
||||
|
||||
_export("foo2", foo2);
|
||||
|
||||
var foo3;
|
||||
|
||||
_export("foo3", foo3);
|
||||
|
||||
let foo4 = 2;
|
||||
|
||||
_export("foo4", foo4);
|
||||
|
||||
let foo5;
|
||||
|
||||
_export("foo5", foo5);
|
||||
|
||||
const foo6 = 3;
|
||||
|
||||
_export("foo6", foo6);
|
||||
|
||||
function foo7() {}
|
||||
|
||||
_export("foo7", foo7);
|
||||
|
||||
class foo8 {}
|
||||
|
||||
_export("foo8", foo8);
|
||||
|
||||
_export("foo3", foo3 = 5);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
System.register("my custom module name", [], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"moduleIds": true,
|
||||
"moduleId": "my custom module name"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { isEven } from "./evens";
|
||||
|
||||
export function nextOdd(n) {
|
||||
return p = isEven(n) ? n + 1 : n + 2;
|
||||
}
|
||||
|
||||
export var p = 5;
|
||||
|
||||
for (var a in b) ;
|
||||
|
||||
for (var i = 0, j = 0;;) ;
|
||||
|
||||
export var isOdd = (function (isEven) {
|
||||
return function (n) {
|
||||
return !isEven(n);
|
||||
};
|
||||
})(isEven);
|
||||
@@ -0,0 +1,34 @@
|
||||
System.register(["./evens"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
var isEven, p, a, i, j, isOdd;
|
||||
|
||||
function nextOdd(n) {
|
||||
return _export("p", p = isEven(n) ? n + 1 : n + 2);
|
||||
}
|
||||
|
||||
_export("nextOdd", nextOdd);
|
||||
|
||||
return {
|
||||
setters: [function (_evens) {
|
||||
isEven = _evens.isEven;
|
||||
}],
|
||||
execute: function () {
|
||||
_export("p", p = 5);
|
||||
|
||||
_export("p", p);
|
||||
|
||||
for (a in b);
|
||||
|
||||
for (i = 0, j = 0;;);
|
||||
|
||||
_export("isOdd", isOdd = function (isEven) {
|
||||
return function (n) {
|
||||
return !isEven(n);
|
||||
};
|
||||
}(isEven));
|
||||
|
||||
_export("isOdd", isOdd);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
export function a() {
|
||||
alert("a");
|
||||
c++;
|
||||
}
|
||||
|
||||
export var c = 5;
|
||||
|
||||
function b() {
|
||||
a();
|
||||
}
|
||||
|
||||
b();
|
||||
@@ -0,0 +1,27 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
var c;
|
||||
|
||||
function a() {
|
||||
alert("a");
|
||||
_export("c", c + 1), c++;
|
||||
}
|
||||
|
||||
_export("a", a);
|
||||
|
||||
function b() {
|
||||
a();
|
||||
}
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
_export("c", c = 5);
|
||||
|
||||
_export("c", c);
|
||||
|
||||
b();
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,2 @@
|
||||
import foo from "foo";
|
||||
import {default as foo2} from "foo";
|
||||
@@ -0,0 +1,12 @@
|
||||
System.register(["foo"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
var foo, foo2;
|
||||
return {
|
||||
setters: [function (_foo) {
|
||||
foo = _foo.default;
|
||||
foo2 = _foo.default;
|
||||
}],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
import * as foo from "foo";
|
||||
11
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-glob/expected.js
vendored
Normal file
11
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-glob/expected.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
System.register(["foo"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
var foo;
|
||||
return {
|
||||
setters: [function (_foo) {
|
||||
foo = _foo;
|
||||
}],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
import foo, {baz as xyz} from "foo";
|
||||
@@ -0,0 +1,12 @@
|
||||
System.register(["foo"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
var foo, xyz;
|
||||
return {
|
||||
setters: [function (_foo) {
|
||||
foo = _foo.default;
|
||||
xyz = _foo.baz;
|
||||
}],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
import {bar} from "foo";
|
||||
import {bar2, baz} from "foo";
|
||||
import {bar as baz2} from "foo";
|
||||
import {bar as baz3, xyz} from "foo";
|
||||
@@ -0,0 +1,16 @@
|
||||
System.register(["foo"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
var bar, bar2, baz, baz2, baz3, xyz;
|
||||
return {
|
||||
setters: [function (_foo) {
|
||||
bar = _foo.bar;
|
||||
bar2 = _foo.bar2;
|
||||
baz = _foo.baz;
|
||||
baz2 = _foo.bar;
|
||||
baz3 = _foo.bar;
|
||||
xyz = _foo.xyz;
|
||||
}],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,2 @@
|
||||
import "2";
|
||||
import "1";
|
||||
@@ -0,0 +1,8 @@
|
||||
System.register(["2", "1"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [function (_) {}, function (_2) {}],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
3
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports/actual.js
vendored
Normal file
3
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import "foo";
|
||||
import "foo-bar";
|
||||
import "./directory/foo-bar";
|
||||
8
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports/expected.js
vendored
Normal file
8
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports/expected.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
System.register(["foo", "foo-bar", "./directory/foo-bar"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [function (_foo) {}, function (_fooBar) {}, function (_directoryFooBar) {}],
|
||||
execute: function () {}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export var name = __moduleName;
|
||||
13
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/module-name/expected.js
vendored
Normal file
13
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/module-name/expected.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
var name;
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
_export("name", name = _context.id);
|
||||
|
||||
_export("name", name);
|
||||
}
|
||||
};
|
||||
});
|
||||
3
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/options.json
vendored
Normal file
3
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["external-helpers", "transform-modules-systemjs"]
|
||||
}
|
||||
12
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/overview/actual.js
vendored
Normal file
12
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/overview/actual.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import "foo";
|
||||
import "foo-bar";
|
||||
import "./directory/foo-bar";
|
||||
import foo from "foo";
|
||||
import * as foo2 from "foo";
|
||||
import {bar} from "foo";
|
||||
import {foo as bar2} from "foo";
|
||||
|
||||
export {test};
|
||||
export var test2 = 5;
|
||||
|
||||
export default test;
|
||||
22
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/overview/expected.js
vendored
Normal file
22
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/overview/expected.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
System.register(["foo", "foo-bar", "./directory/foo-bar"], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
var foo, foo2, bar, bar2, test2;
|
||||
return {
|
||||
setters: [function (_foo) {
|
||||
foo = _foo.default;
|
||||
foo2 = _foo;
|
||||
bar = _foo.bar;
|
||||
bar2 = _foo.foo;
|
||||
}, function (_fooBar) {}, function (_directoryFooBar) {}],
|
||||
execute: function () {
|
||||
_export("test", test);
|
||||
|
||||
_export("test2", test2 = 5);
|
||||
|
||||
_export("test2", test2);
|
||||
|
||||
_export("default", test);
|
||||
}
|
||||
};
|
||||
});
|
||||
21
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/remap/actual.js
vendored
Normal file
21
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/remap/actual.js
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
export var test = 2;
|
||||
test = 5;
|
||||
test++;
|
||||
|
||||
(function () {
|
||||
var test = 2;
|
||||
test = 3;
|
||||
test++;
|
||||
})();
|
||||
|
||||
var a = 2;
|
||||
export { a };
|
||||
a = 3;
|
||||
|
||||
var b = 2;
|
||||
export { b as c };
|
||||
b = 3;
|
||||
|
||||
var d = 3;
|
||||
export { d as e, d as f };
|
||||
d = 4;
|
||||
43
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/remap/expected.js
vendored
Normal file
43
packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/remap/expected.js
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
var test, a, b, d;
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
_export("test", test = 2);
|
||||
|
||||
_export("test", test);
|
||||
|
||||
_export("test", test = 5);
|
||||
|
||||
_export("test", test + 1), test++;
|
||||
|
||||
(function () {
|
||||
var test = 2;
|
||||
test = 3;
|
||||
test++;
|
||||
})();
|
||||
|
||||
_export("a", a = 2);
|
||||
|
||||
_export("a", a);
|
||||
|
||||
_export("a", a = 3);
|
||||
|
||||
_export("c", b = 2);
|
||||
|
||||
_export("c", b);
|
||||
|
||||
_export("c", b = 3);
|
||||
|
||||
_export("f", _export("e", d = 3));
|
||||
|
||||
_export("e", d);
|
||||
|
||||
_export("f", d);
|
||||
|
||||
_export("f", _export("e", d = 4));
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
import runner from "@babel/helper-plugin-test-runner";
|
||||
|
||||
runner(__dirname);
|
||||
Reference in New Issue
Block a user