@zumerbox/build 0.8.3 → 0.8.5

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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ #### [v0.8.5](https://github.com/zumerlab/zumerbox-build/compare/v0.8.4...v0.8.5)
6
+
7
+ > 23 June 2025
8
+
9
+ - Add target [`d683e8d`](https://github.com/zumerlab/zumerbox-build/commit/d683e8d95ef8269d085c646811ab51f457ddd92b)
10
+ - Bumped version [`3926da8`](https://github.com/zumerlab/zumerbox-build/commit/3926da86be0567ed651d944df6e10a863ce07d2e)
11
+
12
+ #### [v0.8.4](https://github.com/zumerlab/zumerbox-build/compare/v0.8.3...v0.8.4)
13
+
14
+ > 31 May 2025
15
+
16
+ - Bumped version [`2466f28`](https://github.com/zumerlab/zumerbox-build/commit/2466f282854ff709f7a5ecd405130c3b8c650777)
17
+ - fix global name [`dc9b43a`](https://github.com/zumerlab/zumerbox-build/commit/dc9b43a078d35a6366d69a9f967af9bc4a18486c)
18
+
5
19
  #### [v0.8.3](https://github.com/zumerlab/zumerbox-build/compare/v0.8.2...v0.8.3)
6
20
 
7
21
  > 31 May 2025
package/bin/index.js CHANGED
@@ -59,10 +59,15 @@ const argv = yargs
59
59
  type: 'boolean',
60
60
  default: false
61
61
  })
62
+ .option('target', {
63
+ alias: 't',
64
+ describe: 'Target JavaScript version (e.g., es2015, es2017, esnext)',
65
+ type: 'string',
66
+ default: 'esnext'
67
+ })
62
68
  .help('h')
63
69
  .alias('h', 'help').argv;
64
70
 
65
-
66
71
  // Read package.json from project directory
67
72
  const packageJsonPath = path.resolve(process.cwd(), './package.json');
68
73
  const pkg = require(packageJsonPath);
@@ -70,7 +75,7 @@ const pkg = require(packageJsonPath);
70
75
  // Use package name from package.json if no name provided
71
76
  const bundlerName = argv.name || pkg.name || 'MyBundler';
72
77
 
73
- let setBanner
78
+ let setBanner;
74
79
  if (pkg) {
75
80
  setBanner = () => `
76
81
  /*
@@ -78,14 +83,14 @@ if (pkg) {
78
83
  * v.${pkg.version}
79
84
  * Author ${pkg.author}
80
85
  * License ${pkg.license}
81
- **/`;
82
-
86
+ **/
87
+ `;
83
88
  } else {
84
89
  setBanner = () => `
85
90
  /*
86
91
  * ${bundlerName}
87
- **/`;
88
-
92
+ **/
93
+ `;
89
94
  }
90
95
 
91
96
  // Configuration for esbuild
@@ -100,7 +105,8 @@ const options = {
100
105
  outdir: argv.outdir,
101
106
  legalComments: argv.comments ? 'inline' : 'none',
102
107
  plugins: [sassPlugin()],
103
- platform: argv.platform
108
+ platform: argv.platform,
109
+ target: argv.target,
104
110
  };
105
111
 
106
112
  if (argv.js) {
@@ -108,14 +114,13 @@ if (argv.js) {
108
114
  }
109
115
 
110
116
  if (argv.global) {
111
- options.globalName.push(bundlerName);
117
+ options.globalName = bundlerName;
112
118
  }
113
119
 
114
120
  if (argv.module) {
115
- options.outExtension = { '.js': '.mjs' }
121
+ options.outExtension = { '.js': '.mjs' };
116
122
  }
117
123
 
118
-
119
124
  if (argv.scss) {
120
125
  options.entryPoints.push(argv.scss);
121
126
  }
@@ -128,23 +133,25 @@ const optionsMinify = {
128
133
  metafile: true,
129
134
  minify: true,
130
135
  plugins: [sassPlugin()],
131
- platform: argv.platform
136
+ platform: argv.platform,
137
+ target: argv.target,
132
138
  };
133
139
 
134
140
  if (argv.global) {
135
- optionsMinify.globalName.push(bundlerName);
141
+ optionsMinify.globalName = bundlerName;
136
142
  }
143
+
137
144
  if (argv.module) {
138
- optionsMinify.outExtension = { '.js': '.mjs' }
145
+ optionsMinify.outExtension = { '.js': '.mjs' };
139
146
  }
140
147
 
141
148
  // Run esbuild
142
149
  esbuild
143
150
  .build(options)
144
151
  .then(() =>
145
- argv.minify ?
146
- esbuild.build(optionsMinify)
147
- : console.log('⚡ Minify skipped ⚡')
152
+ argv.minify
153
+ ? esbuild.build(optionsMinify)
154
+ : console.log('⚡ Minify skipped ⚡')
148
155
  )
149
156
  .then(() => console.log('⚡ Files compiled! ⚡ '))
150
157
  .catch(() => process.exit(1));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zumerbox/build",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "",
5
5
  "author": "Juan Martin Muda",
6
6
  "license": "MIT",