Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for entryFileNames pattern used in combination with prese…
…rveModules option (#3088) * Add support for entryFileNames pattern used in combination with preserveModules option * Add note on pattern usage for preserve modules
- Loading branch information
1 parent
b226036
commit 8dceaf6
Showing
24 changed files
with
159 additions
and
9 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
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
10 changes: 10 additions & 0 deletions
10
test/chunking-form/samples/preserve-modules-filename-pattern/_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,10 @@ | ||
module.exports = { | ||
description: 'entryFileNames pattern supported in combination with preserveModules', | ||
options: { | ||
input: 'src/main.ts', | ||
output: { | ||
entryFileNames: 'entry-[name]-[format].js' | ||
}, | ||
preserveModules: true | ||
} | ||
}; |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/entry-foo-amd.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(['exports'], function (exports) { 'use strict'; | ||
|
||
var foo = 42; | ||
|
||
exports.default = foo; | ||
|
||
}); |
11 changes: 11 additions & 0 deletions
11
test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/entry-main-amd.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 @@ | ||
define(['exports', './entry-foo-amd', './nested/entry-bar-amd', './nested/entry-baz-amd'], function (exports, foo, bar, baz) { 'use strict'; | ||
|
||
|
||
|
||
exports.foo = foo.default; | ||
exports.bar = bar.default; | ||
exports.baz = baz.default; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
7 changes: 7 additions & 0 deletions
7
...king-form/samples/preserve-modules-filename-pattern/_expected/amd/nested/entry-bar-amd.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(['exports'], function (exports) { 'use strict'; | ||
|
||
var bar = 'banana'; | ||
|
||
exports.default = bar; | ||
|
||
}); |
7 changes: 7 additions & 0 deletions
7
...king-form/samples/preserve-modules-filename-pattern/_expected/amd/nested/entry-baz-amd.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(['exports'], function (exports) { 'use strict'; | ||
|
||
var baz = 'whatever'; | ||
|
||
exports.default = baz; | ||
|
||
}); |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/entry-foo-cjs.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'; | ||
|
||
var foo = 42; | ||
|
||
exports.default = foo; |
13 changes: 13 additions & 0 deletions
13
test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/entry-main-cjs.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 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
var foo = require('./entry-foo-cjs.js'); | ||
var bar = require('./nested/entry-bar-cjs.js'); | ||
var baz = require('./nested/entry-baz-cjs.js'); | ||
|
||
|
||
|
||
exports.foo = foo.default; | ||
exports.bar = bar.default; | ||
exports.baz = baz.default; |
5 changes: 5 additions & 0 deletions
5
...king-form/samples/preserve-modules-filename-pattern/_expected/cjs/nested/entry-bar-cjs.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'; | ||
|
||
var bar = 'banana'; | ||
|
||
exports.default = bar; |
5 changes: 5 additions & 0 deletions
5
...king-form/samples/preserve-modules-filename-pattern/_expected/cjs/nested/entry-baz-cjs.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'; | ||
|
||
var baz = 'whatever'; | ||
|
||
exports.default = baz; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/entry-foo-esm.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 @@ | ||
var foo = 42; | ||
|
||
export default foo; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/entry-main-esm.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 @@ | ||
export { default as foo } from './entry-foo-esm.js'; | ||
export { default as bar } from './nested/entry-bar-esm.js'; | ||
export { default as baz } from './nested/entry-baz-esm.js'; |
3 changes: 3 additions & 0 deletions
3
...nking-form/samples/preserve-modules-filename-pattern/_expected/es/nested/entry-bar-esm.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 @@ | ||
var bar = 'banana'; | ||
|
||
export default bar; |
3 changes: 3 additions & 0 deletions
3
...nking-form/samples/preserve-modules-filename-pattern/_expected/es/nested/entry-baz-esm.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 @@ | ||
var baz = 'whatever'; | ||
|
||
export default baz; |
10 changes: 10 additions & 0 deletions
10
...nking-form/samples/preserve-modules-filename-pattern/_expected/system/entry-foo-system.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 () { | ||
|
||
var foo = exports('default', 42); | ||
|
||
} | ||
}; | ||
}); |
17 changes: 17 additions & 0 deletions
17
...king-form/samples/preserve-modules-filename-pattern/_expected/system/entry-main-system.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 @@ | ||
System.register(['./entry-foo-system.js', './nested/entry-bar-system.js', './nested/entry-baz-system.js'], function (exports) { | ||
'use strict'; | ||
return { | ||
setters: [function (module) { | ||
exports('foo', module.default); | ||
}, function (module) { | ||
exports('bar', module.default); | ||
}, function (module) { | ||
exports('baz', module.default); | ||
}], | ||
execute: function () { | ||
|
||
|
||
|
||
} | ||
}; | ||
}); |
10 changes: 10 additions & 0 deletions
10
...orm/samples/preserve-modules-filename-pattern/_expected/system/nested/entry-bar-system.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 () { | ||
|
||
var bar = exports('default', 'banana'); | ||
|
||
} | ||
}; | ||
}); |
10 changes: 10 additions & 0 deletions
10
...orm/samples/preserve-modules-filename-pattern/_expected/system/nested/entry-baz-system.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 () { | ||
|
||
var baz = exports('default', 'whatever'); | ||
|
||
} | ||
}; | ||
}); |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/preserve-modules-filename-pattern/src/foo.ts
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 default 42; |
6 changes: 6 additions & 0 deletions
6
test/chunking-form/samples/preserve-modules-filename-pattern/src/main.ts
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,6 @@ | ||
// @ts-ignore | ||
export { default as foo } from './foo.ts'; | ||
// @ts-ignore | ||
export { default as bar } from './nested/bar.ts'; | ||
// @ts-ignore | ||
export { default as baz } from './nested/baz.ts'; |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/preserve-modules-filename-pattern/src/nested/bar.ts
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 default 'banana'; |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/preserve-modules-filename-pattern/src/nested/baz.ts
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 default 'whatever'; |