-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
2e9d487
commit cb76695
Showing
19 changed files
with
143 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = { | ||
solo: true, | ||
description: 'handles amd.id with the [id] pattern', | ||
options: { | ||
input: ['main'], | ||
output: { | ||
name: 'outputName', | ||
amd: { | ||
id: 'something/[id]' | ||
} | ||
} | ||
}, | ||
additionalFormats: ['umd'], | ||
runAmd: exports => { | ||
return exports.getA(); | ||
} | ||
}; |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/amd-id-code-split/_expected/amd/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,9 @@ | ||
define('something/main', ['exports'], function (exports) { 'use strict'; | ||
|
||
const something = 42; | ||
|
||
exports.something = something; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/amd-id-code-split/_expected/cjs/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,7 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const something = 42; | ||
|
||
exports.something = something; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/amd-id-code-split/_expected/es/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,3 @@ | ||
const something = 42; | ||
|
||
export { something }; |
10 changes: 10 additions & 0 deletions
10
test/chunking-form/samples/amd-id-code-split/_expected/system/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,10 @@ | ||
System.register('outputName', [], function (exports) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
const something = exports('something', 42); | ||
|
||
} | ||
}; | ||
}); |
13 changes: 13 additions & 0 deletions
13
test/chunking-form/samples/amd-id-code-split/_expected/umd/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,13 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define('something/main', ['exports'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.outputName = {})); | ||
}(this, (function (exports) { 'use strict'; | ||
|
||
const something = 42; | ||
|
||
exports.something = something; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}))); |
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 something = 42; |
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,13 @@ | ||
module.exports = { | ||
solo: true, | ||
description: 'handles amd.id with the [id] pattern and code splitting', | ||
options: { | ||
input: ['main'], | ||
output: { | ||
amd: { | ||
id: 'something/[id]' | ||
} | ||
} | ||
}, | ||
runAmd: true | ||
}; |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/amd-id/_expected/amd/generated-a.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 @@ | ||
define('something/generated-a', ['exports'], function (exports) { 'use strict'; | ||
|
||
const something = 42; | ||
|
||
exports.something = something; | ||
|
||
}); |
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 @@ | ||
define('something/main', ['require', 'exports'], function (require, exports) { 'use strict'; | ||
|
||
function getA() { | ||
return new Promise(function (resolve, reject) { require(['./generated-a'], resolve, reject) }); | ||
} | ||
|
||
exports.getA = getA; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/amd-id/_expected/cjs/generated-a.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,5 @@ | ||
'use strict'; | ||
|
||
const something = 42; | ||
|
||
exports.something = something; |
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,9 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
function getA() { | ||
return Promise.resolve().then(function () { return require('./generated-a.js'); }); | ||
} | ||
|
||
exports.getA = getA; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/amd-id/_expected/es/generated-a.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,3 @@ | ||
const something = 42; | ||
|
||
export { something }; |
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,5 @@ | ||
function getA() { | ||
return import('./generated-a.js'); | ||
} | ||
|
||
export { getA }; |
10 changes: 10 additions & 0 deletions
10
test/chunking-form/samples/amd-id/_expected/system/generated-a.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,10 @@ | ||
System.register([], function (exports) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
const something = exports('something', 42); | ||
|
||
} | ||
}; | ||
}); |
14 changes: 14 additions & 0 deletions
14
test/chunking-form/samples/amd-id/_expected/system/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,14 @@ | ||
System.register([], function (exports, module) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
exports('getA', getA); | ||
|
||
function getA() { | ||
return module.import('./generated-a.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 something = 42; |
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,3 @@ | ||
export function getA() { | ||
return import('./a'); | ||
} |