Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16e4cff
commit 0bc81a6
Showing
22 changed files
with
110 additions
and
31 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/dynamic-import-inlining-object/_config.js
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
description: 'supports an object with a single entry when inlining dynamic imports', | ||
options: { | ||
inlineDynamicImports: true, | ||
input: { entry: 'main' } | ||
} | ||
}; |
17 changes: 17 additions & 0 deletions
17
test/chunking-form/samples/dynamic-import-inlining-object/_expected/amd/entry.js
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
define(['exports'], function (exports) { 'use strict'; | ||
|
||
const bar = 2; | ||
Promise.resolve().then(function () { return foo$1; }); | ||
|
||
const foo = 1; | ||
|
||
var foo$1 = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
foo: foo | ||
}); | ||
|
||
exports.bar = bar; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
15 changes: 15 additions & 0 deletions
15
test/chunking-form/samples/dynamic-import-inlining-object/_expected/cjs/entry.js
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const bar = 2; | ||
Promise.resolve().then(function () { return foo$1; }); | ||
|
||
const foo = 1; | ||
|
||
var foo$1 = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
foo: foo | ||
}); | ||
|
||
exports.bar = bar; |
11 changes: 11 additions & 0 deletions
11
test/chunking-form/samples/dynamic-import-inlining-object/_expected/es/entry.js
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const bar = 2; | ||
Promise.resolve().then(function () { return foo$1; }); | ||
|
||
const foo = 1; | ||
|
||
var foo$1 = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
foo: foo | ||
}); | ||
|
||
export { bar }; |
18 changes: 18 additions & 0 deletions
18
test/chunking-form/samples/dynamic-import-inlining-object/_expected/system/entry.js
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
System.register([], function (exports) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
const bar = exports('bar', 2); | ||
Promise.resolve().then(function () { return foo$1; }); | ||
|
||
const foo = 1; | ||
|
||
var foo$1 = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
foo: foo | ||
}); | ||
|
||
} | ||
}; | ||
}); |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/dynamic-import-inlining-object/foo.js
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export const foo = 1; |
2 changes: 2 additions & 0 deletions
2
test/chunking-form/samples/dynamic-import-inlining-object/main.js
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const bar = 2; | ||
import('./foo.js'); |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
description: 'supports an array with a single entry when inlining dynamic imports', | ||
options: { | ||
inlineDynamicImports: true, | ||
input: ['main'] | ||
} | ||
}; |
11 changes: 11 additions & 0 deletions
11
test/form/samples/dynamic-import-inlining-array/_expected.js
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const bar = 2; | ||
Promise.resolve().then(function () { return foo$1; }); | ||
|
||
const foo = 1; | ||
|
||
var foo$1 = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
foo: foo | ||
}); | ||
|
||
export { bar }; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export const foo = 1; |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const bar = 2; | ||
import('./foo.js'); |
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
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
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
2 changes: 1 addition & 1 deletion
2
...s/inline-imports-with-multiple/_config.js → ...ne-imports-with-multiple-array/_config.js
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
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
test/function/samples/inline-imports-with-multiple-object/_config.js
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
description: 'Having multiple inputs in an object is not supported when inlining dynamic imports', | ||
options: { | ||
input: { main: 'main.js', lib: 'lib.js' }, | ||
inlineDynamicImports: true | ||
}, | ||
error: { | ||
code: 'INVALID_OPTION', | ||
message: 'Multiple inputs are not supported for "inlineDynamicImports".' | ||
} | ||
}; |
1 change: 1 addition & 0 deletions
1
test/function/samples/inline-imports-with-multiple-object/lib.js
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export const value = 42; |
1 change: 1 addition & 0 deletions
1
test/function/samples/inline-imports-with-multiple-object/main.js
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
import('./lib').then(({value}) => assert.equal(value, 42)); |