-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] Generate webpack-compatible output with static string arg
Closes #88.
- Loading branch information
1 parent
6937e76
commit cedd31d
Showing
40 changed files
with
311 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
var testModule = Promise.resolve('test-module').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
var testModule = Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('test-module')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
const testModule = Promise.resolve('test-module').then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
const testModule = Promise.resolve().then(() => babelHelpers.interopRequireWildcard(require('test-module'))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
const testModule = Promise.resolve('test-module').then(s => require(s)); | ||
const testModule = Promise.resolve().then(() => require('test-module')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
var testModule = Promise.resolve('test-module').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
var testModule = Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('test-module')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
const testModule = Promise.resolve('test-module').then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
const testModule = Promise.resolve().then(() => babelHelpers.interopRequireWildcard(require('test-module'))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
const testModule = Promise.resolve('test-module').then(s => require(s)); | ||
const testModule = Promise.resolve().then(() => require('test-module')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
Promise.resolve('test-module').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('test-module')); | ||
}).then(function () { | ||
return Promise.resolve('test-module-2').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
return Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('test-module-2')); | ||
}); | ||
}); | ||
|
||
Promise.all([Promise.resolve('test-1').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
}), Promise.resolve('test-2').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
}), Promise.resolve('test-3').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
Promise.all([Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('test-1')); | ||
}), Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('test-2')); | ||
}), Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('test-3')); | ||
})]).then(function () {}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Promise.resolve('test-module').then(s => require(s)).then(() => Promise.resolve('test-module-2').then(s => require(s))); | ||
Promise.resolve().then(() => require('test-module')).then(() => Promise.resolve().then(() => require('test-module-2'))); | ||
|
||
Promise.all([Promise.resolve('test-1').then(s => require(s)), Promise.resolve('test-2').then(s => require(s)), Promise.resolve('test-3').then(s => require(s))]).then(() => {}); | ||
Promise.all([Promise.resolve().then(() => require('test-1')), Promise.resolve().then(() => require('test-2')), Promise.resolve().then(() => require('test-3'))]).then(() => {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
Promise.resolve('test-module').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('test-module')); | ||
}).then(function () { | ||
return Promise.resolve('test-module-2').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
return Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('test-module-2')); | ||
}); | ||
}); | ||
Promise.all([Promise.resolve('test-1').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
}), Promise.resolve('test-2').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
}), Promise.resolve('test-3').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
Promise.all([Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('test-1')); | ||
}), Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('test-2')); | ||
}), Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('test-3')); | ||
})]).then(function () {}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Promise.resolve('test-module').then(s => require(s)).then(() => Promise.resolve('test-module-2').then(s => require(s))); | ||
Promise.all([Promise.resolve('test-1').then(s => require(s)), Promise.resolve('test-2').then(s => require(s)), Promise.resolve('test-3').then(s => require(s))]).then(() => {}); | ||
Promise.resolve().then(() => require('test-module')).then(() => Promise.resolve().then(() => require('test-module-2'))); | ||
Promise.all([Promise.resolve().then(() => require('test-1')), Promise.resolve().then(() => require('test-2')), Promise.resolve().then(() => require('test-3'))]).then(() => {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
const MODULE = Object('test-module'); | ||
|
||
import(MODULE); | ||
import(`test-${MODULE}`); | ||
|
||
let i = 0; | ||
import(i++); | ||
|
||
import(fn()); | ||
|
||
async () => import(await "x"); | ||
|
||
function* f() { import(yield "x"); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,74 @@ | ||
var MODULE = Object('test-module'); | ||
var _this = this; | ||
|
||
Promise.resolve('' + String(MODULE)).then(function (s) { | ||
var _marked = /*#__PURE__*/regeneratorRuntime.mark(f); | ||
|
||
Promise.resolve("" + String(MODULE)).then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
}); | ||
|
||
var i = 0; | ||
Promise.resolve("" + i++).then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
}); | ||
Promise.resolve('test-' + String(MODULE)).then(function (s) { | ||
|
||
Promise.resolve("" + String(fn())).then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
}); | ||
|
||
babelHelpers.asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
_context.t0 = Promise; | ||
_context.t1 = String; | ||
_context.next = 4; | ||
return "x"; | ||
|
||
case 4: | ||
_context.t2 = _context.sent; | ||
_context.t3 = (0, _context.t1)(_context.t2); | ||
_context.t4 = "" + _context.t3; | ||
|
||
_context.t5 = function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
}; | ||
|
||
return _context.abrupt("return", _context.t0.resolve.call(_context.t0, _context.t4).then(_context.t5)); | ||
|
||
case 9: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee, _this); | ||
})); | ||
|
||
function f() { | ||
return regeneratorRuntime.wrap(function f$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
_context2.t0 = Promise; | ||
_context2.t1 = String; | ||
_context2.next = 4; | ||
return "x"; | ||
|
||
case 4: | ||
_context2.t2 = _context2.sent; | ||
_context2.t3 = (0, _context2.t1)(_context2.t2); | ||
_context2.t4 = "" + _context2.t3; | ||
|
||
_context2.t5 = function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
}; | ||
|
||
_context2.t0.resolve.call(_context2.t0, _context2.t4).then(_context2.t5); | ||
|
||
case 9: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
} | ||
}, _marked, this); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
const MODULE = Object('test-module'); | ||
|
||
Promise.resolve(`${MODULE}`).then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
Promise.resolve(`test-${MODULE}`).then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
|
||
let i = 0; | ||
Promise.resolve(`${i++}`).then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
|
||
Promise.resolve(`${fn()}`).then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
|
||
async () => Promise.resolve(`${await "x"}`).then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
|
||
function* f() { | ||
Promise.resolve(`${yield "x"}`).then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
const MODULE = Object('test-module'); | ||
|
||
Promise.resolve(`${MODULE}`).then(s => require(s)); | ||
Promise.resolve(`test-${MODULE}`).then(s => require(s)); | ||
|
||
let i = 0; | ||
Promise.resolve(`${i++}`).then(s => require(s)); | ||
|
||
Promise.resolve(`${fn()}`).then(s => require(s)); | ||
|
||
async () => Promise.resolve(`${await "x"}`).then(s => require(s)); | ||
|
||
function* f() { | ||
Promise.resolve(`${yield "x"}`).then(s => require(s)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,64 @@ | ||
var MODULE = Object('test-module'); | ||
var _marked = /*#__PURE__*/regeneratorRuntime.mark(f); | ||
|
||
Promise.resolve("".concat(MODULE)).then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
}); | ||
Promise.resolve("test-".concat(MODULE)).then(function (s) { | ||
var i = 0; | ||
Promise.resolve("".concat(i++)).then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
}); | ||
Promise.resolve("".concat(fn())).then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
}); | ||
|
||
/*#__PURE__*/ | ||
babelHelpers.asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
_context.t0 = Promise; | ||
_context.t1 = ""; | ||
_context.next = 4; | ||
return "x"; | ||
|
||
case 4: | ||
_context.t2 = _context.sent; | ||
_context.t3 = _context.t1.concat.call(_context.t1, _context.t2); | ||
return _context.abrupt("return", _context.t0.resolve.call(_context.t0, _context.t3).then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
})); | ||
|
||
case 7: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee); | ||
})); | ||
|
||
function f() { | ||
return regeneratorRuntime.wrap(function f$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
_context2.t0 = Promise; | ||
_context2.t1 = ""; | ||
_context2.next = 4; | ||
return "x"; | ||
|
||
case 4: | ||
_context2.t2 = _context2.sent; | ||
_context2.t3 = _context2.t1.concat.call(_context2.t1, _context2.t2); | ||
|
||
_context2.t0.resolve.call(_context2.t0, _context2.t3).then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
}); | ||
|
||
case 7: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
} | ||
}, _marked); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
const MODULE = Object('test-module'); | ||
Promise.resolve(`${MODULE}`).then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
Promise.resolve(`test-${MODULE}`).then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
let i = 0; | ||
Promise.resolve(`${i++}`).then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
Promise.resolve(`${fn()}`).then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
|
||
async () => Promise.resolve(`${await "x"}`).then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
|
||
function* f() { | ||
Promise.resolve(`${yield "x"}`).then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
const MODULE = Object('test-module'); | ||
Promise.resolve(`${MODULE}`).then(s => require(s)); | ||
Promise.resolve(`test-${MODULE}`).then(s => require(s)); | ||
let i = 0; | ||
Promise.resolve(`${i++}`).then(s => require(s)); | ||
Promise.resolve(`${fn()}`).then(s => require(s)); | ||
|
||
async () => Promise.resolve(`${await "x"}`).then(s => require(s)); | ||
|
||
function* f() { | ||
Promise.resolve(`${yield "x"}`).then(s => require(s)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Promise.resolve('my-module').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('my-module')); | ||
}); | ||
Promise.resolve('my-module').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('my-module')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Promise.resolve('my-module').then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
Promise.resolve('my-module').then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
Promise.resolve().then(() => babelHelpers.interopRequireWildcard(require('my-module'))); | ||
Promise.resolve().then(() => babelHelpers.interopRequireWildcard(require('my-module'))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Promise.resolve('my-module').then(s => require(s)); | ||
Promise.resolve('my-module').then(s => require(s)); | ||
Promise.resolve().then(() => require('my-module')); | ||
Promise.resolve().then(() => require('my-module')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Promise.resolve('my-module').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('my-module')); | ||
}); | ||
Promise.resolve('my-module').then(function (s) { | ||
return babelHelpers.interopRequireWildcard(require(s)); | ||
Promise.resolve().then(function () { | ||
return babelHelpers.interopRequireWildcard(require('my-module')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Promise.resolve('my-module').then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
Promise.resolve('my-module').then(s => babelHelpers.interopRequireWildcard(require(s))); | ||
Promise.resolve().then(() => babelHelpers.interopRequireWildcard(require('my-module'))); | ||
Promise.resolve().then(() => babelHelpers.interopRequireWildcard(require('my-module'))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Promise.resolve('my-module').then(s => require(s)); | ||
Promise.resolve('my-module').then(s => require(s)); | ||
Promise.resolve().then(() => require('my-module')); | ||
Promise.resolve().then(() => require('my-module')); |
Oops, something went wrong.