@module-federation/esbuild 0.0.94 → 0.0.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/adapters/lib/collect-exports.js +151 -0
  2. package/dist/adapters/lib/collect-exports.mjs +87 -0
  3. package/dist/adapters/lib/commonjs.js +260 -0
  4. package/dist/adapters/lib/commonjs.mjs +209 -0
  5. package/dist/adapters/lib/containerPlugin.js +232 -0
  6. package/dist/adapters/lib/containerPlugin.mjs +182 -0
  7. package/dist/adapters/lib/containerReference.js +219 -0
  8. package/dist/adapters/lib/containerReference.mjs +154 -0
  9. package/dist/adapters/lib/lexer.js +184 -0
  10. package/dist/adapters/lib/lexer.mjs +138 -0
  11. package/dist/adapters/lib/linkRemotesPlugin.js +115 -0
  12. package/dist/adapters/lib/linkRemotesPlugin.mjs +50 -0
  13. package/dist/adapters/lib/manifest.js +229 -0
  14. package/dist/adapters/lib/manifest.mjs +168 -0
  15. package/dist/adapters/lib/plugin.js +339 -0
  16. package/dist/adapters/lib/plugin.mjs +282 -0
  17. package/dist/adapters/lib/react-replacements.js +81 -0
  18. package/dist/adapters/lib/react-replacements.mjs +35 -0
  19. package/dist/adapters/lib/transform.js +169 -0
  20. package/dist/adapters/lib/transform.mjs +120 -0
  21. package/dist/adapters/lib/utils.js +83 -0
  22. package/dist/adapters/lib/utils.mjs +33 -0
  23. package/dist/build.js +131 -473
  24. package/dist/build.mjs +13 -380
  25. package/dist/index.js +41 -26
  26. package/dist/index.mjs +4 -1
  27. package/dist/lib/config/configuration-context.js +70 -0
  28. package/dist/lib/config/configuration-context.mjs +20 -0
  29. package/dist/lib/config/federation-config.js +31 -0
  30. package/dist/lib/config/federation-config.mjs +4 -0
  31. package/dist/lib/config/share-utils.js +339 -0
  32. package/dist/lib/config/share-utils.mjs +254 -0
  33. package/dist/lib/config/with-native-federation.js +118 -0
  34. package/dist/lib/config/with-native-federation.mjs +71 -0
  35. package/dist/lib/core/build-adapter.js +70 -0
  36. package/dist/lib/core/build-adapter.mjs +18 -0
  37. package/dist/lib/core/createContainerTemplate.js +231 -0
  38. package/dist/lib/core/createContainerTemplate.mjs +185 -0
  39. package/dist/lib/core/default-skip-list.js +99 -0
  40. package/dist/lib/core/default-skip-list.mjs +47 -0
  41. package/dist/lib/core/federation-options.js +31 -0
  42. package/dist/lib/core/federation-options.mjs +4 -0
  43. package/dist/lib/core/get-externals.js +65 -0
  44. package/dist/lib/core/get-externals.mjs +19 -0
  45. package/dist/lib/core/load-federation-config.js +69 -0
  46. package/dist/lib/core/load-federation-config.mjs +20 -0
  47. package/dist/lib/core/write-federation-info.js +65 -0
  48. package/dist/lib/core/write-federation-info.mjs +16 -0
  49. package/dist/lib/utils/logger.js +111 -0
  50. package/dist/lib/utils/logger.mjs +46 -0
  51. package/dist/lib/utils/mapped-paths.js +94 -0
  52. package/dist/lib/utils/mapped-paths.mjs +46 -0
  53. package/dist/lib/utils/normalize.js +63 -0
  54. package/dist/lib/utils/normalize.mjs +17 -0
  55. package/dist/lib/utils/package-info.js +324 -0
  56. package/dist/lib/utils/package-info.mjs +265 -0
  57. package/dist/plugin.d.ts +1 -0
  58. package/dist/plugin.js +79 -1231
  59. package/dist/plugin.mjs +2 -1187
  60. package/dist/resolve/esm-resolver.mjs +15 -22
  61. package/package.json +2 -2
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
3
+ return typeof document === 'undefined'
4
+ ? new (require('url'.replace('', '')).URL)('file:' + __filename).href
5
+ : (document.currentScript && document.currentScript.src) ||
6
+ new URL('main.js', document.baseURI).href;
7
+ })();
8
+ ;
9
+ // The require scope
10
+ var __webpack_require__ = {};
11
+
12
+ /************************************************************************/
13
+ // webpack/runtime/compat_get_default_export
14
+ (() => {
15
+ // getDefaultExport function for compatibility with non-ESM modules
16
+ __webpack_require__.n = (module) => {
17
+ var getter = module && module.__esModule ?
18
+ () => (module['default']) :
19
+ () => (module);
20
+ __webpack_require__.d(getter, { a: getter });
21
+ return getter;
22
+ };
23
+
24
+ })();
25
+ // webpack/runtime/define_property_getters
26
+ (() => {
27
+ __webpack_require__.d = (exports, definition) => {
28
+ for(var key in definition) {
29
+ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
30
+ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
31
+ }
32
+ }
33
+ };
34
+ })();
35
+ // webpack/runtime/has_own_property
36
+ (() => {
37
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
38
+ })();
39
+ // webpack/runtime/make_namespace_object
40
+ (() => {
41
+ // define __esModule on exports
42
+ __webpack_require__.r = (exports) => {
43
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
44
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
45
+ }
46
+ Object.defineProperty(exports, '__esModule', { value: true });
47
+ };
48
+ })();
49
+ /************************************************************************/
50
+ var __webpack_exports__ = {};
51
+ // ESM COMPAT FLAG
52
+ __webpack_require__.r(__webpack_exports__);
53
+
54
+ // EXPORTS
55
+ __webpack_require__.d(__webpack_exports__, {
56
+ resolvePackageJson: () => (/* binding */ resolvePackageJson),
57
+ resolve: () => (/* binding */ resolve),
58
+ getExports: () => (/* binding */ getExports)
59
+ });
60
+
61
+ ;// CONCATENATED MODULE: external "es-module-lexer"
62
+ const external_es_module_lexer_namespaceObject = require("es-module-lexer");
63
+ ;// CONCATENATED MODULE: external "cjs-module-lexer"
64
+ const external_cjs_module_lexer_namespaceObject = require("cjs-module-lexer");
65
+ ;// CONCATENATED MODULE: external "util"
66
+ const external_util_namespaceObject = require("util");
67
+ ;// CONCATENATED MODULE: external "enhanced-resolve"
68
+ const external_enhanced_resolve_namespaceObject = require("enhanced-resolve");
69
+ var external_enhanced_resolve_default = /*#__PURE__*/__webpack_require__.n(external_enhanced_resolve_namespaceObject);
70
+ ;// CONCATENATED MODULE: external "fs"
71
+ const external_fs_namespaceObject = require("fs");
72
+ var external_fs_default = /*#__PURE__*/__webpack_require__.n(external_fs_namespaceObject);
73
+ ;// CONCATENATED MODULE: external "path"
74
+ const external_path_namespaceObject = require("path");
75
+ var external_path_default = /*#__PURE__*/__webpack_require__.n(external_path_namespaceObject);
76
+ ;// CONCATENATED MODULE: ./src/adapters/lib/collect-exports.ts
77
+
78
+
79
+
80
+
81
+
82
+
83
+ const resolve = (0,external_util_namespaceObject.promisify)(external_enhanced_resolve_default().create({
84
+ mainFields: [
85
+ 'browser',
86
+ 'module',
87
+ 'main'
88
+ ]
89
+ }));
90
+ const resolvePackageJson = async (packageName, callback)=>{
91
+ try {
92
+ const filepath = await resolve(__dirname, packageName);
93
+ if (typeof filepath !== 'string') {
94
+ return callback(new Error('Failed to resolve package path'));
95
+ }
96
+ // Resolve the path to the package.json file
97
+ const packageJsonPath = external_path_default().join(filepath, 'package.json');
98
+ if (external_fs_default().existsSync(packageJsonPath)) {
99
+ callback(null, packageJsonPath);
100
+ } else {
101
+ callback(new Error(`package.json not found for package: ${packageName}`));
102
+ }
103
+ } catch (err) {
104
+ callback(err);
105
+ }
106
+ };
107
+ async function getExports(modulePath) {
108
+ await external_es_module_lexer_namespaceObject.init;
109
+ await external_cjs_module_lexer_namespaceObject.init;
110
+ try {
111
+ const exports = [];
112
+ const paths = [];
113
+ const resolvedPath = await resolve(process.cwd(), modulePath);
114
+ if (typeof resolvedPath === 'string') {
115
+ paths.push(resolvedPath);
116
+ }
117
+ while(paths.length > 0){
118
+ const currentPath = paths.pop();
119
+ if (currentPath) {
120
+ const content = await external_fs_default().promises.readFile(currentPath, 'utf8');
121
+ try {
122
+ const { exports: cjsExports } = (0,external_cjs_module_lexer_namespaceObject.parse)(content);
123
+ exports.push(...cjsExports);
124
+ } catch {
125
+ const [, esExports] = (0,external_es_module_lexer_namespaceObject.parse)(content);
126
+ exports.push(...esExports.map((exp)=>exp.n));
127
+ }
128
+ // TODO: Handle re-exports
129
+ }
130
+ }
131
+ if (!exports.includes('default')) {
132
+ exports.push('default');
133
+ }
134
+ return exports;
135
+ } catch (e) {
136
+ console.log(e);
137
+ return [
138
+ 'default'
139
+ ];
140
+ }
141
+ }
142
+
143
+ exports.getExports = __webpack_exports__.getExports;
144
+ exports.resolve = __webpack_exports__.resolve;
145
+ exports.resolvePackageJson = __webpack_exports__.resolvePackageJson;
146
+ for(var __webpack_i__ in __webpack_exports__) {
147
+ if(["getExports","resolve","resolvePackageJson"].indexOf(__webpack_i__) === -1) {
148
+ exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
149
+ }
150
+ }
151
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,87 @@
1
+ import { init, parse } from "es-module-lexer";
2
+ import { init as external_cjs_module_lexer_init, parse as external_cjs_module_lexer_parse } from "cjs-module-lexer";
3
+ import { promisify } from "util";
4
+ import enhanced_resolve from "enhanced-resolve";
5
+ import fs from "fs";
6
+ import path from "path";
7
+
8
+ ;// CONCATENATED MODULE: external "es-module-lexer"
9
+
10
+ ;// CONCATENATED MODULE: external "cjs-module-lexer"
11
+
12
+ ;// CONCATENATED MODULE: external "util"
13
+
14
+ ;// CONCATENATED MODULE: external "enhanced-resolve"
15
+
16
+ ;// CONCATENATED MODULE: external "fs"
17
+
18
+ ;// CONCATENATED MODULE: external "path"
19
+
20
+ ;// CONCATENATED MODULE: ./src/adapters/lib/collect-exports.ts
21
+
22
+
23
+
24
+
25
+
26
+
27
+ const resolve = promisify(enhanced_resolve.create({
28
+ mainFields: [
29
+ 'browser',
30
+ 'module',
31
+ 'main'
32
+ ]
33
+ }));
34
+ const resolvePackageJson = async (packageName, callback)=>{
35
+ try {
36
+ const filepath = await resolve(__dirname, packageName);
37
+ if (typeof filepath !== 'string') {
38
+ return callback(new Error('Failed to resolve package path'));
39
+ }
40
+ // Resolve the path to the package.json file
41
+ const packageJsonPath = path.join(filepath, 'package.json');
42
+ if (fs.existsSync(packageJsonPath)) {
43
+ callback(null, packageJsonPath);
44
+ } else {
45
+ callback(new Error(`package.json not found for package: ${packageName}`));
46
+ }
47
+ } catch (err) {
48
+ callback(err);
49
+ }
50
+ };
51
+ async function getExports(modulePath) {
52
+ await init;
53
+ await external_cjs_module_lexer_init;
54
+ try {
55
+ const exports = [];
56
+ const paths = [];
57
+ const resolvedPath = await resolve(process.cwd(), modulePath);
58
+ if (typeof resolvedPath === 'string') {
59
+ paths.push(resolvedPath);
60
+ }
61
+ while(paths.length > 0){
62
+ const currentPath = paths.pop();
63
+ if (currentPath) {
64
+ const content = await fs.promises.readFile(currentPath, 'utf8');
65
+ try {
66
+ const { exports: cjsExports } = external_cjs_module_lexer_parse(content);
67
+ exports.push(...cjsExports);
68
+ } catch {
69
+ const [, esExports] = parse(content);
70
+ exports.push(...esExports.map((exp)=>exp.n));
71
+ }
72
+ // TODO: Handle re-exports
73
+ }
74
+ }
75
+ if (!exports.includes('default')) {
76
+ exports.push('default');
77
+ }
78
+ return exports;
79
+ } catch (e) {
80
+ console.log(e);
81
+ return [
82
+ 'default'
83
+ ];
84
+ }
85
+ }
86
+
87
+ export { getExports, resolve, resolvePackageJson };
@@ -0,0 +1,260 @@
1
+ "use strict";
2
+ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
3
+ return typeof document === 'undefined'
4
+ ? new (require('url'.replace('', '')).URL)('file:' + __filename).href
5
+ : (document.currentScript && document.currentScript.src) ||
6
+ new URL('main.js', document.baseURI).href;
7
+ })();
8
+ ;
9
+ var __webpack_modules__ = ({
10
+ "esbuild": (function (module) {
11
+ module.exports = require("esbuild");
12
+
13
+ }),
14
+ "cjs-module-lexer": (function (module) {
15
+ module.exports = import("cjs-module-lexer").then(function(module) { return module; });
16
+
17
+ }),
18
+
19
+ });
20
+ /************************************************************************/
21
+ // The module cache
22
+ var __webpack_module_cache__ = {};
23
+
24
+ // The require function
25
+ function __webpack_require__(moduleId) {
26
+
27
+ // Check if module is in cache
28
+ var cachedModule = __webpack_module_cache__[moduleId];
29
+ if (cachedModule !== undefined) {
30
+ return cachedModule.exports;
31
+ }
32
+ // Create a new module (and put it into the cache)
33
+ var module = (__webpack_module_cache__[moduleId] = {
34
+ exports: {}
35
+ });
36
+ // Execute the module function
37
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
38
+
39
+ // Return the exports of the module
40
+ return module.exports;
41
+
42
+ }
43
+
44
+ /************************************************************************/
45
+ // webpack/runtime/define_property_getters
46
+ (() => {
47
+ __webpack_require__.d = (exports, definition) => {
48
+ for(var key in definition) {
49
+ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
50
+ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
51
+ }
52
+ }
53
+ };
54
+ })();
55
+ // webpack/runtime/has_own_property
56
+ (() => {
57
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
58
+ })();
59
+ // webpack/runtime/make_namespace_object
60
+ (() => {
61
+ // define __esModule on exports
62
+ __webpack_require__.r = (exports) => {
63
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
64
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
65
+ }
66
+ Object.defineProperty(exports, '__esModule', { value: true });
67
+ };
68
+ })();
69
+ /************************************************************************/
70
+ var __webpack_exports__ = {};
71
+ // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
72
+ (() => {
73
+ // ESM COMPAT FLAG
74
+ __webpack_require__.r(__webpack_exports__);
75
+
76
+ // EXPORTS
77
+ __webpack_require__.d(__webpack_exports__, {
78
+ commonjs: () => (/* binding */ commonjs_commonjs),
79
+ "default": () => (/* binding */ commonjs)
80
+ });
81
+
82
+ ;// CONCATENATED MODULE: external "fs"
83
+ const external_fs_namespaceObject = require("fs");
84
+ ;// CONCATENATED MODULE: external "./lexer.js"
85
+ const external_lexer_js_namespaceObject = require("./lexer.js");
86
+ ;// CONCATENATED MODULE: external "./utils.js"
87
+ const external_utils_js_namespaceObject = require("./utils.js");
88
+ ;// CONCATENATED MODULE: ./src/adapters/lib/commonjs.ts
89
+
90
+
91
+
92
+ function commonjs_commonjs({ filter = /\.c?js$/, transform = true, transformConfig, requireReturnsDefault = true, ignore } = {}) {
93
+ const init_cjs_module_lexer = transform ? Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, "cjs-module-lexer")) : undefined;
94
+ const use_default_export = typeof requireReturnsDefault === 'function' ? requireReturnsDefault : (_path)=>requireReturnsDefault;
95
+ const is_ignored = typeof ignore === 'function' ? ignore : Array.isArray(ignore) ? (path)=>ignore.includes(path) : ()=>false;
96
+ return {
97
+ name: 'commonjs',
98
+ setup ({ onLoad, esbuild, initialOptions }) {
99
+ let esbuild_shim;
100
+ const require_esbuild = ()=>esbuild || (esbuild_shim ||= __webpack_require__("esbuild"));
101
+ const read = external_fs_namespaceObject.promises.readFile;
102
+ const lexer = new external_lexer_js_namespaceObject.Lexer();
103
+ //@ts-ignore
104
+ onLoad({
105
+ filter: filter
106
+ }, async (args)=>{
107
+ let parseCJS;
108
+ if (init_cjs_module_lexer) {
109
+ const { init, parse } = await init_cjs_module_lexer;
110
+ await init();
111
+ parseCJS = parse;
112
+ }
113
+ let contents;
114
+ try {
115
+ //@ts-ignore
116
+ contents = await read(args.path, 'utf8');
117
+ } catch {
118
+ return null;
119
+ }
120
+ const willTransform = transform === true || typeof transform === 'function' && transform(args.path);
121
+ let cjsExports;
122
+ try {
123
+ if (parseCJS && willTransform) {
124
+ // move sourcemap to the end of the transformed file
125
+ const sourcemapIndex = contents.lastIndexOf('//# sourceMappingURL=');
126
+ let sourcemap;
127
+ if (sourcemapIndex !== -1) {
128
+ sourcemap = contents.slice(sourcemapIndex);
129
+ const sourcemapEnd = sourcemap.indexOf('\n');
130
+ if (sourcemapEnd !== -1 && sourcemap.slice(sourcemapEnd + 1).trimStart().length > 0) {
131
+ // if there's code after sourcemap, it is invalid, don't do this.
132
+ sourcemap = undefined;
133
+ } else {
134
+ contents = contents.slice(0, sourcemapIndex);
135
+ }
136
+ }
137
+ // transform commonjs to es modules, easy mode
138
+ cjsExports = parseCJS(contents);
139
+ let { behavior, exports, sideEffects } = typeof willTransform === 'object' ? willTransform : {};
140
+ behavior ??= (transformConfig === null || transformConfig === void 0 ? void 0 : transformConfig.behavior) ?? 'node';
141
+ exports = (0,external_utils_js_namespaceObject.orderedUniq)(cjsExports.exports.concat(exports ?? []));
142
+ sideEffects ??= (transformConfig === null || transformConfig === void 0 ? void 0 : transformConfig.sideEffects) ?? true;
143
+ let exportDefault = behavior === 'node' ? 'export default exports;' : 'export default exports.__esModule ? exports.default : exports;';
144
+ let exportsMap = exports.map((e)=>[
145
+ e,
146
+ (0,external_utils_js_namespaceObject.makeLegalIdentifier)(e)
147
+ ]);
148
+ if (exportsMap.some(([e])=>e === 'default')) {
149
+ if (behavior === 'node') {
150
+ exportsMap = exportsMap.filter(([e])=>e !== 'default');
151
+ } else {
152
+ exportDefault = '';
153
+ }
154
+ }
155
+ const reexports = cjsExports.reexports.map((e)=>`export * from ${JSON.stringify(e)};`).join('');
156
+ let transformed;
157
+ if (sideEffects === false) {
158
+ transformed = [
159
+ // make sure we don't manipulate the first line so that sourcemap is fine
160
+ reexports + 'var mod, exports = /* @__PURE__ */ ((exports, module) => {' + contents,
161
+ 'return module.exports})((mod = { exports: {} }).exports, mod); ' + exportDefault
162
+ ];
163
+ if (exportsMap.length > 0) {
164
+ for (const [e, name] of exportsMap){
165
+ transformed.push(`var ${name} = /* @__PURE__ */ (() => exports[${JSON.stringify(e)}])();`);
166
+ }
167
+ transformed.push(`export { ${exportsMap.map(([e, name])=>e === name ? e : `${name} as ${JSON.stringify(e)}`).join(', ')} };`);
168
+ }
169
+ } else {
170
+ transformed = [
171
+ reexports + 'var exports = {}, module = { exports }; {' + contents,
172
+ '}; exports = module.exports; ' + exportDefault
173
+ ];
174
+ if (exportsMap.length > 0) {
175
+ transformed.push(`var { ${exportsMap.map(([e, name])=>e === name ? e : `${JSON.stringify(e)}: ${name}`).join(', ')} } = exports;`, `export { ${exportsMap.map(([e, name])=>e === name ? e : `${name} as ${JSON.stringify(e)}`).join(', ')} };`);
176
+ }
177
+ }
178
+ contents = transformed.join('\n') + (sourcemap ? '\n' + sourcemap : '');
179
+ }
180
+ } catch (e) {
181
+ return null;
182
+ }
183
+ function makeName(path) {
184
+ let name = `__import_${(0,external_utils_js_namespaceObject.makeLegalIdentifier)(path)}`;
185
+ if (contents.includes(name)) {
186
+ let suffix = 2;
187
+ while(contents.includes(`${name}${suffix}`))suffix++;
188
+ name = `${name}${suffix}`;
189
+ }
190
+ return name;
191
+ }
192
+ let warnings;
193
+ try {
194
+ ({ warnings } = await require_esbuild().transform(contents, {
195
+ format: 'esm',
196
+ logLevel: 'silent'
197
+ }));
198
+ } catch (err) {
199
+ ({ warnings } = err);
200
+ }
201
+ const lines = contents.split('\n');
202
+ const getOffset = (0,external_utils_js_namespaceObject.cachedReduce)(lines, (a, b)=>a + 1 + b.length, 0);
203
+ if (warnings && (warnings = warnings.filter((e)=>e.text.includes('"require" to "esm"'))).length) {
204
+ const edits = [];
205
+ let imports = [];
206
+ for (const { location } of warnings){
207
+ if (location === null) continue;
208
+ const { line, lineText, column, length } = location;
209
+ const leftBrace = column + length + 1;
210
+ const path = lexer.readString(lineText, leftBrace);
211
+ if (path === null || is_ignored(path)) continue;
212
+ const rightBrace = lineText.indexOf(')', leftBrace + 2 + path.length) + 1;
213
+ const name = makeName(path);
214
+ let import_statement;
215
+ if (use_default_export(path)) {
216
+ import_statement = `import ${name} from ${JSON.stringify(path)};`;
217
+ } else {
218
+ import_statement = `import * as ${name} from ${JSON.stringify(path)};`;
219
+ }
220
+ const offset = getOffset(line - 1);
221
+ edits.push([
222
+ offset + column,
223
+ offset + rightBrace,
224
+ name
225
+ ]);
226
+ imports.push(import_statement);
227
+ }
228
+ if (imports.length === 0) return null;
229
+ imports = (0,external_utils_js_namespaceObject.orderedUniq)(imports);
230
+ let offset = 0;
231
+ for (const [start, end, name] of edits){
232
+ contents = contents.slice(0, start + offset) + name + contents.slice(end + offset);
233
+ offset += name.length - (end - start);
234
+ }
235
+ // if we have transformed this module (i.e. having `cjsExports`), don't make the file commonjs
236
+ contents = [
237
+ ...imports,
238
+ cjsExports ? 'exports;' : '',
239
+ contents
240
+ ].join('');
241
+ return {
242
+ contents
243
+ };
244
+ }
245
+ });
246
+ }
247
+ };
248
+ }
249
+ /* ESM default export */ const commonjs = (commonjs_commonjs);
250
+
251
+ })();
252
+
253
+ exports.commonjs = __webpack_exports__.commonjs;
254
+ exports["default"] = __webpack_exports__["default"];
255
+ for(var __webpack_i__ in __webpack_exports__) {
256
+ if(["commonjs","default"].indexOf(__webpack_i__) === -1) {
257
+ exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
258
+ }
259
+ }
260
+ Object.defineProperty(exports, '__esModule', { value: true });