@hypernym/bundler 0.4.0 → 0.5.0

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.
@@ -25,7 +25,7 @@ const externals = [
25
25
  ];
26
26
 
27
27
  const name = "bundler";
28
- const version = `0.4.0`;
28
+ const version = `0.5.0`;
29
29
 
30
30
  const cl = console.log;
31
31
  const logger = {
@@ -217,7 +217,13 @@ async function build(cwd, options) {
217
217
  plugins: [esbuild(entry.plugins?.esbuild)],
218
218
  pluginsOptions: entry.plugins,
219
219
  banner: entry.banner,
220
- footer: entry.footer
220
+ footer: entry.footer,
221
+ intro: entry.intro,
222
+ outro: entry.outro,
223
+ paths: entry.paths,
224
+ name: entry.name,
225
+ globals: entry.globals,
226
+ extend: entry.extend
221
227
  };
222
228
  if (_entry.pluginsOptions?.json) {
223
229
  const jsonOptions = isObject(_entry.pluginsOptions.json) ? _entry.pluginsOptions.json : void 0;
@@ -251,7 +257,13 @@ async function build(cwd, options) {
251
257
  file: resolve(cwd, _entry.output),
252
258
  format: _entry.format,
253
259
  banner: _entry.banner,
254
- footer: _entry.footer
260
+ footer: _entry.footer,
261
+ intro: _entry.intro,
262
+ outro: _entry.outro,
263
+ paths: _entry.paths,
264
+ name: _entry.name,
265
+ globals: _entry.globals,
266
+ extend: _entry.extend
255
267
  });
256
268
  const stats = await stat(resolve(cwd, _entry.output));
257
269
  buildStats.files.push({
@@ -280,7 +292,10 @@ async function build(cwd, options) {
280
292
  plugins: [dts(entry.plugins?.dts)],
281
293
  pluginsOptions: entry.plugins,
282
294
  banner: entry.banner,
283
- footer: entry.footer
295
+ footer: entry.footer,
296
+ intro: entry.intro,
297
+ outro: entry.outro,
298
+ paths: entry.paths
284
299
  };
285
300
  if (hooks?.["build:entry:start"]) {
286
301
  await hooks["build:entry:start"](_entry, buildStats);
@@ -298,7 +313,10 @@ async function build(cwd, options) {
298
313
  file: resolve(cwd, _entry.output),
299
314
  format: _entry.format,
300
315
  banner: _entry.banner,
301
- footer: _entry.footer
316
+ footer: _entry.footer,
317
+ intro: _entry.intro,
318
+ outro: _entry.outro,
319
+ paths: _entry.paths
302
320
  });
303
321
  const stats = await stat(resolve(cwd, _entry.output));
304
322
  buildStats.files.push({
@@ -51,6 +51,24 @@ interface EntryBase {
51
51
  * @default undefined
52
52
  */
53
53
  footer?: OutputOptions['footer'];
54
+ /**
55
+ * Specifies the code at the beginning that goes inside any _format-specific_ wrapper.
56
+ *
57
+ * @default undefined
58
+ */
59
+ intro?: OutputOptions['intro'];
60
+ /**
61
+ * Specifies the code at the end that goes inside any _format-specific_ wrapper.
62
+ *
63
+ * @default undefined
64
+ */
65
+ outro?: OutputOptions['outro'];
66
+ /**
67
+ * Maps external module IDs to paths.
68
+ *
69
+ * @default undefined
70
+ */
71
+ paths?: OutputOptions['paths'];
54
72
  /**
55
73
  * Specifies custom filters that will display only certain log messages.
56
74
  *
@@ -69,6 +87,28 @@ interface EntryInput extends EntryBase {
69
87
  * @default undefined
70
88
  */
71
89
  plugins?: PluginsInput;
90
+ /**
91
+ * Specifies the global variable name that representing exported bundle.
92
+ *
93
+ * Intended for `umd/iife` formats.
94
+ *
95
+ * @default undefined
96
+ */
97
+ name?: OutputOptions['name'];
98
+ /**
99
+ * Specifies global _module ID_ and _variable name_ pairs necessary for external imports.
100
+ *
101
+ * Intended for `umd/iife` formats.
102
+ *
103
+ * @default undefined
104
+ */
105
+ globals?: OutputOptions['globals'];
106
+ /**
107
+ * Specifies whether to extend the global variable defined by the `name` option.
108
+ *
109
+ * Intended for `umd/iife` formats.
110
+ */
111
+ extend?: OutputOptions['extend'];
72
112
  }
73
113
  interface EntryTypes extends EntryBase {
74
114
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypernym/bundler",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "author": "Hypernym Studio",
5
5
  "description": "ESM & TS module bundler.",
6
6
  "license": "MIT",