fix: fix npm build error
This commit is contained in:
parent
5fb069f432
commit
a3b7a6537a
|
|
@ -1,6 +1,6 @@
|
||||||
// #!/usr/bin/env node
|
// #!/usr/bin/env node
|
||||||
|
|
||||||
import { sh } from 'tasksfile';
|
// import { sh } from 'tasksfile';
|
||||||
|
|
||||||
import { argv } from 'yargs';
|
import { argv } from 'yargs';
|
||||||
import { runBuildConfig } from './buildConf';
|
import { runBuildConfig } from './buildConf';
|
||||||
|
|
@ -11,12 +11,12 @@ import { startGzipStyle } from '../plugin/gzip/compress';
|
||||||
export const runBuild = async () => {
|
export const runBuild = async () => {
|
||||||
try {
|
try {
|
||||||
const argvList = argv._;
|
const argvList = argv._;
|
||||||
let cmd = `cross-env NODE_ENV=production vite build`;
|
// let cmd = `cross-env NODE_ENV=production vite build`;
|
||||||
// await run('cross-env', ['NODE_ENV=production', 'vite', 'build']);
|
// // await run('cross-env', ['NODE_ENV=production', 'vite', 'build']);
|
||||||
await sh(cmd, {
|
// await sh(cmd, {
|
||||||
async: true,
|
// async: true,
|
||||||
nopipe: true,
|
// nopipe: true,
|
||||||
});
|
// });
|
||||||
|
|
||||||
// Generate configuration file
|
// Generate configuration file
|
||||||
if (!argvList.includes('no-conf')) {
|
if (!argvList.includes('no-conf')) {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"bootstrap": "yarn install",
|
"bootstrap": "yarn install",
|
||||||
"serve": "cross-env ts-node --files -P ./build/tsconfig.json ./build/script/preserve && cross-env NODE_ENV=development vite",
|
"serve": "cross-env ts-node --files -P ./build/tsconfig.json ./build/script/preserve && cross-env NODE_ENV=development vite",
|
||||||
"build": "node ./build/jsc.ts build",
|
"build": "cross-env NODE_ENV=production vite build && node ./build/jsc.ts build",
|
||||||
"build:site": "cross-env SITE=true npm run build ",
|
"build:site": "cross-env SITE=true npm run build ",
|
||||||
"build:no-cache": "yarn clean:cache && node ./build/jsc.ts build",
|
"build:no-cache": "yarn clean:cache && node ./build/jsc.ts build",
|
||||||
"report": "cross-env REPORT=true npm run build ",
|
"report": "cross-env REPORT=true npm run build ",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue