Commit a3b7a6537ae25af076fdcccb50dd6967f0def40b
1 parent
5fb069f4
fix: fix npm build error
Showing
2 changed files
with
8 additions
and
8 deletions
build/script/build.ts
1 | 1 | // #!/usr/bin/env node |
2 | 2 | |
3 | -import { sh } from 'tasksfile'; | |
3 | +// import { sh } from 'tasksfile'; | |
4 | 4 | |
5 | 5 | import { argv } from 'yargs'; |
6 | 6 | import { runBuildConfig } from './buildConf'; |
... | ... | @@ -11,12 +11,12 @@ import { startGzipStyle } from '../plugin/gzip/compress'; |
11 | 11 | export const runBuild = async () => { |
12 | 12 | try { |
13 | 13 | const argvList = argv._; |
14 | - let cmd = `cross-env NODE_ENV=production vite build`; | |
15 | - // await run('cross-env', ['NODE_ENV=production', 'vite', 'build']); | |
16 | - await sh(cmd, { | |
17 | - async: true, | |
18 | - nopipe: true, | |
19 | - }); | |
14 | + // let cmd = `cross-env NODE_ENV=production vite build`; | |
15 | + // // await run('cross-env', ['NODE_ENV=production', 'vite', 'build']); | |
16 | + // await sh(cmd, { | |
17 | + // async: true, | |
18 | + // nopipe: true, | |
19 | + // }); | |
20 | 20 | |
21 | 21 | // Generate configuration file |
22 | 22 | if (!argvList.includes('no-conf')) { | ... | ... |
package.json
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | "scripts": { |
5 | 5 | "bootstrap": "yarn install", |
6 | 6 | "serve": "cross-env ts-node --files -P ./build/tsconfig.json ./build/script/preserve && cross-env NODE_ENV=development vite", |
7 | - "build": "node ./build/jsc.ts build", | |
7 | + "build": "cross-env NODE_ENV=production vite build && node ./build/jsc.ts build", | |
8 | 8 | "build:site": "cross-env SITE=true npm run build ", |
9 | 9 | "build:no-cache": "yarn clean:cache && node ./build/jsc.ts build", |
10 | 10 | "report": "cross-env REPORT=true npm run build ", | ... | ... |