app-bundler 0.2.4 → 0.2.6
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.
- package/lib/bundler.js +25 -0
- package/lib/cli.js +25 -0
- package/package.json +1 -1
package/lib/bundler.js
CHANGED
|
@@ -4954,6 +4954,20 @@ var __register, __require, require;
|
|
|
4954
4954
|
}));
|
|
4955
4955
|
|
|
4956
4956
|
// end:source ./UMD.js
|
|
4957
|
+
`,
|
|
4958
|
+
ESM: `
|
|
4959
|
+
// source ./ESM.js
|
|
4960
|
+
var module = {
|
|
4961
|
+
exports: {}
|
|
4962
|
+
};
|
|
4963
|
+
|
|
4964
|
+
$MODULE$
|
|
4965
|
+
|
|
4966
|
+
export default module.exports;
|
|
4967
|
+
|
|
4968
|
+
$CUSTOM_EXPORTS_CODE$
|
|
4969
|
+
|
|
4970
|
+
// end:source ./ESM.js
|
|
4957
4971
|
`,
|
|
4958
4972
|
Style: `
|
|
4959
4973
|
// source ./Style.js
|
|
@@ -5220,6 +5234,9 @@ class ModuleWrapper {
|
|
|
5220
5234
|
case 'umd':
|
|
5221
5235
|
body = this.wrapWithUMD(body);
|
|
5222
5236
|
break;
|
|
5237
|
+
case 'esm':
|
|
5238
|
+
body = this.wrapWithESM(body);
|
|
5239
|
+
break;
|
|
5223
5240
|
case 'custom':
|
|
5224
5241
|
body = this.wrapWithCustom(body);
|
|
5225
5242
|
break;
|
|
@@ -5246,6 +5263,14 @@ class ModuleWrapper {
|
|
|
5246
5263
|
.replace('%MODULE%', () => body)
|
|
5247
5264
|
.replace('%NAME%', () => name);
|
|
5248
5265
|
}
|
|
5266
|
+
wrapWithESM(body) {
|
|
5267
|
+
var opts = this.solution.opts.package;
|
|
5268
|
+
var exportsCode = opts.moduleExportsCode || '';
|
|
5269
|
+
return Templates_1.Templates
|
|
5270
|
+
.ESM
|
|
5271
|
+
.replace('$CUSTOM_EXPORTS_CODE$', () => exportsCode)
|
|
5272
|
+
.replace('$MODULE$', () => body);
|
|
5273
|
+
}
|
|
5249
5274
|
wrapWithCustom(body) {
|
|
5250
5275
|
let opts = this.solution.opts.package;
|
|
5251
5276
|
let template = Templates_1.Templates.load(opts.moduleWrapperCustomPath);
|
package/lib/cli.js
CHANGED
|
@@ -4956,6 +4956,20 @@ var __register, __require, require;
|
|
|
4956
4956
|
}));
|
|
4957
4957
|
|
|
4958
4958
|
// end:source ./UMD.js
|
|
4959
|
+
`,
|
|
4960
|
+
ESM: `
|
|
4961
|
+
// source ./ESM.js
|
|
4962
|
+
var module = {
|
|
4963
|
+
exports: {}
|
|
4964
|
+
};
|
|
4965
|
+
|
|
4966
|
+
$MODULE$
|
|
4967
|
+
|
|
4968
|
+
export default module.exports;
|
|
4969
|
+
|
|
4970
|
+
$CUSTOM_EXPORTS_CODE$
|
|
4971
|
+
|
|
4972
|
+
// end:source ./ESM.js
|
|
4959
4973
|
`,
|
|
4960
4974
|
Style: `
|
|
4961
4975
|
// source ./Style.js
|
|
@@ -5222,6 +5236,9 @@ class ModuleWrapper {
|
|
|
5222
5236
|
case 'umd':
|
|
5223
5237
|
body = this.wrapWithUMD(body);
|
|
5224
5238
|
break;
|
|
5239
|
+
case 'esm':
|
|
5240
|
+
body = this.wrapWithESM(body);
|
|
5241
|
+
break;
|
|
5225
5242
|
case 'custom':
|
|
5226
5243
|
body = this.wrapWithCustom(body);
|
|
5227
5244
|
break;
|
|
@@ -5248,6 +5265,14 @@ class ModuleWrapper {
|
|
|
5248
5265
|
.replace('%MODULE%', () => body)
|
|
5249
5266
|
.replace('%NAME%', () => name);
|
|
5250
5267
|
}
|
|
5268
|
+
wrapWithESM(body) {
|
|
5269
|
+
var opts = this.solution.opts.package;
|
|
5270
|
+
var exportsCode = opts.moduleExportsCode || '';
|
|
5271
|
+
return Templates_1.Templates
|
|
5272
|
+
.ESM
|
|
5273
|
+
.replace('$CUSTOM_EXPORTS_CODE$', () => exportsCode)
|
|
5274
|
+
.replace('$MODULE$', () => body);
|
|
5275
|
+
}
|
|
5251
5276
|
wrapWithCustom(body) {
|
|
5252
5277
|
let opts = this.solution.opts.package;
|
|
5253
5278
|
let template = Templates_1.Templates.load(opts.moduleWrapperCustomPath);
|