@tmbr/bundler 1.12.5 → 1.12.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.
Files changed (2) hide show
  1. package/cli.js +10 -3
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -16,7 +16,7 @@ const command = process.argv[2];
16
16
 
17
17
  if (!['build', 'watch'].includes(command)) {
18
18
  console.log(`Invalid command: ${chalk.red(command)}\n`);
19
- process.exit();
19
+ process.exit(1);
20
20
  }
21
21
 
22
22
  const logger = (options = {}) => ({
@@ -145,14 +145,21 @@ async function main() {
145
145
  });
146
146
  }
147
147
 
148
- if (process.argv[3] && fs.existsSync(process.argv[3])) {
148
+ if (process.argv[3]) {
149
+
150
+ const file = process.argv[3];
151
+
152
+ if (!fs.existsSync(file)) {
153
+ console.log(`Config file not found: ${chalk.red(file)}\n`);
154
+ process.exit(1);
155
+ }
149
156
 
150
157
  function extend(options, config) {
151
158
  if (typeof config === 'undefined') return;
152
159
  Object.assign(options, typeof config === 'function' ? config(options) : config);
153
160
  }
154
161
 
155
- import(`${cwd}/${process.argv[3]}`).then(settings => {
162
+ import(`${cwd}/${file}`).then(settings => {
156
163
  extend(watchOptions, settings.watch);
157
164
  extend(buildOptions, settings.build);
158
165
  extend(serveOptions, settings.serve);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tmbr/bundler",
3
3
  "type": "module",
4
- "version": "1.12.5",
4
+ "version": "1.12.6",
5
5
  "repository": "github:nikrowell/tmbr-bundler",
6
6
  "bin": {
7
7
  "bundler": "cli.js",