Skip to content

Commit

Permalink
fix: 修正构建目录结构嵌套
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Jul 26, 2024
1 parent 743cbb1 commit 96951f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Command } from 'commander';
import fs from 'fs';
import path from 'path';
import { description } from '../package.json';
import { pkgName, pkgVersion } from './const';
import { resolveConfigFile, run } from './generators/command';

Expand All @@ -11,7 +10,7 @@ export function createCLI() {
program
.name(pkgName)
.version(pkgVersion)
.description(description)
.description(process.env.PKG_DESCRIPTION)
.action((options, command) => {
if (command.args.length === 0) return run();

Expand Down
3 changes: 3 additions & 0 deletions src/types/process.env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ declare global {

// package version
PKG_VERSION: string;

// package description
PKG_DESCRIPTION: string;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default defineConfig({
define: {
'process.env.PKG_NAME': JSON.stringify(pkg.name),
'process.env.PKG_VERSION': JSON.stringify(pkg.version),
'process.env.PKG_DESCRIPTION': JSON.stringify(pkg.description),
},
build: {
minify: false,
Expand Down Expand Up @@ -51,6 +52,7 @@ export default defineConfig({
env: {
PKG_NAME: 'pkg-name-for-test',
PKG_VERSION: 'pkg-version-for-test',
PKG_DESCRIPTION: 'pkg-description-for-test',
},
coverage: {
all: true,
Expand Down

0 comments on commit 96951f8

Please sign in to comment.