Skip to content

Commit

Permalink
feat: name option defaulting to package name
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 10, 2022
1 parent 67a1253 commit c3979ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export async function build (rootDir: string, stub: boolean, inputConfig: BuildC

// Merge options
const options = defu(buildConfig, pkg.unbuild || pkg.build, inputConfig, preset, <BuildOptions>{
name: (pkg?.name || '').split('/').pop() || 'default',
rootDir,
entries: [],
clean: true,
Expand Down Expand Up @@ -173,7 +174,7 @@ export async function build (rootDir: string, stub: boolean, inputConfig: BuildC
}

// Done info
consola.success(chalk.green('Build succeeded for ' + pkg.name))
consola.success(chalk.green('Build succeeded for ' + options.name))
for (const entry of ctx.buildEntries) {
consola.log(` ${chalk.bold(entry.path)} (` + [
entry.bytes && `size: ${chalk.cyan(prettyBytes(entry.bytes))}`,
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface RollupBuildOptions {
}

export interface BuildOptions {
name: string
rootDir: string
entries: BuildEntry[],
clean: boolean
Expand Down

0 comments on commit c3979ab

Please sign in to comment.