Skip to content

Commit 680c25c

Browse files
G3rootdevelopitnafees nazik
authored
Fix: throw a warning when no entrypoint is found (#843)
Co-authored-by: Jason Miller <[email protected]> Co-authored-by: nafees nazik <[email protected]>
1 parent 86371f0 commit 680c25c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from 'fs';
22
import { resolve, relative, dirname, basename, extname } from 'path';
33
import camelCase from 'camelcase';
44
import escapeStringRegexp from 'escape-string-regexp';
5-
import { blue } from 'kleur';
5+
import { blue, red } from 'kleur';
66
import { map, series } from 'asyncro';
77
import glob from 'tiny-glob/sync';
88
import autoprefixer from 'autoprefixer';
@@ -130,7 +130,10 @@ export default async function microbundle(inputOptions) {
130130
);
131131

132132
const targetDir = relative(cwd, dirname(options.output)) || '.';
133-
const banner = blue(`Build "${options.name}" to ${targetDir}:`);
133+
const sourceExist = options.input.length > 0;
134+
const banner = sourceExist
135+
? blue(`Build "${options.name}" to ${targetDir}:`)
136+
: red(`Error: No entry module found for "${options.name}"`);
134137
return {
135138
output: `${banner}\n ${out.join('\n ')}`,
136139
};

0 commit comments

Comments
 (0)