@@ -55,71 +55,15 @@ test('resolve with condition exports', async () => {
5555
5656 expect ( isSuccess ) . toBeTruthy ( ) ;
5757
58- if ( process . env . ADVANCED_ESM ) {
59- expect ( nodeResults ) . toMatchInlineSnapshot ( `
60- [
61- "const value = 'lib2 module';
62- export { value };
63- ",
64- "import { __webpack_require__ } from "./runtime.js";
65- __webpack_require__.add({
66- "./node_modules/lib1/src/index.cjs": function(module) {
67- module.exports.value = 'lib1 cjs';
68- }
69- });
70- ",
71- "const value = 'lib1 mjs';
72- export { value };
73- ",
74- "import { value } from "./767.js";
75- console.log(value);
76- ",
77- "import { value } from "./192.js";
78- console.log(value);
79- ",
80- "console.log("node");
81- ",
82- "import { __webpack_require__ } from "./runtime.js";
83- import "./75.js";
84- __webpack_require__.add({
85- "./entry4.ts": function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
86- console.log(__webpack_require__("./node_modules/lib1/src/index.cjs").value);
87- }
88- });
89- __webpack_require__("./entry4.ts");
90- ",
91- "var __webpack_modules__ = {};
92- var __webpack_module_cache__ = {};
93- function __webpack_require__(moduleId) {
94- var cachedModule = __webpack_module_cache__[moduleId];
95- if (void 0 !== cachedModule) return cachedModule.exports;
96- var module = __webpack_module_cache__[moduleId] = {
97- exports: {}
98- };
99- __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
100- return module.exports;
101- }
102- __webpack_require__.m = __webpack_modules__;
103- (()=>{
104- __webpack_require__.add = function(modules) {
105- Object.assign(__webpack_require__.m, modules);
106- };
107- })();
108- export { __webpack_require__ };
109- ",
110- ]
111- ` ) ;
112- } else {
113- expect ( nodeResults [ 0 ] ) . toContain ( 'lib1 mjs' ) ;
114- expect ( nodeResults [ 1 ] ) . toContain ( 'lib2 module' ) ;
115- expect ( nodeResults [ 2 ] ) . toContain ( 'node' ) ;
116- expect ( nodeResults [ 3 ] ) . toContain ( 'lib1 cjs' ) ;
58+ expect ( nodeResults [ 0 ] ) . toContain ( 'lib1 mjs' ) ;
59+ expect ( nodeResults [ 1 ] ) . toContain ( 'lib2 module' ) ;
60+ expect ( nodeResults [ 2 ] ) . toContain ( 'node' ) ;
61+ expect ( nodeResults [ 3 ] ) . toContain ( 'lib1 cjs' ) ;
11762
118- expect ( browserResults [ 0 ] ) . toContain ( 'lib1 mjs' ) ;
119- expect ( browserResults [ 1 ] ) . toContain ( 'lib2 module' ) ;
120- expect ( browserResults [ 2 ] ) . toContain ( 'browser' ) ;
121- expect ( browserResults [ 3 ] ) . toContain ( 'lib1 cjs' ) ;
122- }
63+ expect ( browserResults [ 0 ] ) . toContain ( 'lib1 mjs' ) ;
64+ expect ( browserResults [ 1 ] ) . toContain ( 'lib2 module' ) ;
65+ expect ( browserResults [ 2 ] ) . toContain ( 'browser' ) ;
66+ expect ( browserResults [ 3 ] ) . toContain ( 'lib1 cjs' ) ;
12367} ) ;
12468
12569test ( 'resolve with js extensions' , async ( ) => {
0 commit comments