Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: get right sideEffectModules (#5029)
* fix: get right SideEffectModules * chore: remove field solo in tests * add conditions Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com> --------- Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
- Loading branch information
1 parent
abd289d
commit be39a57
Showing
22 changed files
with
220 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
21 changes: 21 additions & 0 deletions
21
test/chunking-form/samples/chunk-assigment-in-dynamic/_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,21 @@ | ||
const path = require('node:path'); | ||
const commonjs = require('@rollup/plugin-commonjs'); | ||
|
||
module.exports = defineTest({ | ||
description: 'the content of c.js is complete', | ||
options: { | ||
plugins: [ | ||
commonjs(), | ||
{ | ||
resolveId(id) { | ||
if (id === './c.js') { | ||
return { | ||
id: path.resolve('./c.js'), | ||
moduleSideEffects: false | ||
}; | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}); |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/chunk-assigment-in-dynamic/_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,9 @@ | ||
define(['exports', './generated-c'], (function (exports, c) { 'use strict'; | ||
|
||
function A() { | ||
return { icon: c.c.faPrint }; | ||
} | ||
|
||
exports.A = A; | ||
|
||
})); |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/amd/generated-b.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(['exports', './generated-c'], (function (exports, c) { 'use strict'; | ||
|
||
function B() { | ||
return { icon: c.c.faPrint }; | ||
} | ||
|
||
exports.B = B; | ||
|
||
})); |
15 changes: 15 additions & 0 deletions
15
test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/amd/generated-c.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 @@ | ||
define(['exports'], (function (exports) { 'use strict'; | ||
|
||
var c = {}; | ||
|
||
(function (exports) { | ||
exports.preFaPrint = { | ||
foo: 1 | ||
}; | ||
|
||
exports.faPrint = exports.preFaPrint; | ||
} (c)); | ||
|
||
exports.c = c; | ||
|
||
})); |
8 changes: 8 additions & 0 deletions
8
test/chunking-form/samples/chunk-assigment-in-dynamic/_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,8 @@ | ||
define(['require'], (function (require) { 'use strict'; | ||
|
||
const importA = () => new Promise(function (resolve, reject) { require(['./generated-a'], resolve, reject); }); | ||
const importB = () => new Promise(function (resolve, reject) { require(['./generated-b'], resolve, reject); }); | ||
|
||
console.log(importA, importB); | ||
|
||
})); |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/chunk-assigment-in-dynamic/_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,9 @@ | ||
'use strict'; | ||
|
||
var c = require('./generated-c.js'); | ||
|
||
function A() { | ||
return { icon: c.c.faPrint }; | ||
} | ||
|
||
exports.A = A; |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/cjs/generated-b.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 @@ | ||
'use strict'; | ||
|
||
var c = require('./generated-c.js'); | ||
|
||
function B() { | ||
return { icon: c.c.faPrint }; | ||
} | ||
|
||
exports.B = B; |
13 changes: 13 additions & 0 deletions
13
test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/cjs/generated-c.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'; | ||
|
||
var c = {}; | ||
|
||
(function (exports) { | ||
exports.preFaPrint = { | ||
foo: 1 | ||
}; | ||
|
||
exports.faPrint = exports.preFaPrint; | ||
} (c)); | ||
|
||
exports.c = c; |
6 changes: 6 additions & 0 deletions
6
test/chunking-form/samples/chunk-assigment-in-dynamic/_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,6 @@ | ||
'use strict'; | ||
|
||
const importA = () => Promise.resolve().then(function () { return require('./generated-a.js'); }); | ||
const importB = () => Promise.resolve().then(function () { return require('./generated-b.js'); }); | ||
|
||
console.log(importA, importB); |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/chunk-assigment-in-dynamic/_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,7 @@ | ||
import { c } from './generated-c.js'; | ||
|
||
function A() { | ||
return { icon: c.faPrint }; | ||
} | ||
|
||
export { A }; |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/es/generated-b.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 @@ | ||
import { c } from './generated-c.js'; | ||
|
||
function B() { | ||
return { icon: c.faPrint }; | ||
} | ||
|
||
export { B }; |
11 changes: 11 additions & 0 deletions
11
test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/es/generated-c.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 @@ | ||
var c = {}; | ||
|
||
(function (exports) { | ||
exports.preFaPrint = { | ||
foo: 1 | ||
}; | ||
|
||
exports.faPrint = exports.preFaPrint; | ||
} (c)); | ||
|
||
export { c }; |
4 changes: 4 additions & 0 deletions
4
test/chunking-form/samples/chunk-assigment-in-dynamic/_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,4 @@ | ||
const importA = () => import('./generated-a.js'); | ||
const importB = () => import('./generated-b.js'); | ||
|
||
console.log(importA, importB); |
18 changes: 18 additions & 0 deletions
18
test/chunking-form/samples/chunk-assigment-in-dynamic/_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,18 @@ | ||
System.register(['./generated-c.js'], (function (exports) { | ||
'use strict'; | ||
var c; | ||
return { | ||
setters: [function (module) { | ||
c = module.c; | ||
}], | ||
execute: (function () { | ||
|
||
exports('A', A); | ||
|
||
function A() { | ||
return { icon: c.faPrint }; | ||
} | ||
|
||
}) | ||
}; | ||
})); |
18 changes: 18 additions & 0 deletions
18
test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/system/generated-b.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(['./generated-c.js'], (function (exports) { | ||
'use strict'; | ||
var c; | ||
return { | ||
setters: [function (module) { | ||
c = module.c; | ||
}], | ||
execute: (function () { | ||
|
||
exports('B', B); | ||
|
||
function B() { | ||
return { icon: c.faPrint }; | ||
} | ||
|
||
}) | ||
}; | ||
})); |
18 changes: 18 additions & 0 deletions
18
test/chunking-form/samples/chunk-assigment-in-dynamic/_expected/system/generated-c.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 () { | ||
|
||
var c = exports('c', {}); | ||
|
||
(function (exports) { | ||
exports.preFaPrint = { | ||
foo: 1 | ||
}; | ||
|
||
exports.faPrint = exports.preFaPrint; | ||
} (c)); | ||
|
||
}) | ||
}; | ||
})); |
13 changes: 13 additions & 0 deletions
13
test/chunking-form/samples/chunk-assigment-in-dynamic/_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,13 @@ | ||
System.register([], (function (exports, module) { | ||
'use strict'; | ||
return { | ||
execute: (function () { | ||
|
||
const importA = () => module.import('./generated-a.js'); | ||
const importB = () => module.import('./generated-b.js'); | ||
|
||
console.log(importA, importB); | ||
|
||
}) | ||
}; | ||
})); |
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 @@ | ||
import { faPrint } from './c.js'; | ||
|
||
export function A() { | ||
return { icon: faPrint }; | ||
} |
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 @@ | ||
import { faPrint } from './c.js'; | ||
|
||
export function B() { | ||
return { icon: faPrint }; | ||
} |
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 @@ | ||
exports.preFaPrint = { | ||
foo: 1 | ||
}; | ||
|
||
exports.faPrint = exports.preFaPrint; |
4 changes: 4 additions & 0 deletions
4
test/chunking-form/samples/chunk-assigment-in-dynamic/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,4 @@ | ||
const importA = () => import('./a.js'); | ||
const importB = () => import('./b.js'); | ||
|
||
console.log(importA, importB); |