refactor: add vite-plugin-html. Delete updateHtml related logic

This commit is contained in:
vben
2020-10-27 21:21:14 +08:00
parent 7bd0b8eb6f
commit 173d402162
19 changed files with 224 additions and 286 deletions

View File

@@ -4,15 +4,15 @@ import { sh } from 'tasksfile';
import { argv } from 'yargs';
import { runBuildConfig } from './buildConf';
import { runUpdateHtml } from './updateHtml';
// import { runUpdateHtml } from './updateHtml';
import { errorConsole, successConsole } from '../utils';
import { startGzipStyle } from '../plugin/gzip/compress';
import { startGzipStyle } from '../vite/plugin/gzip/compress';
export const runBuild = async (preview = false) => {
try {
const argvList = argv._;
if (preview) {
let cmd = `npm run build`;
let cmd = `cross-env NODE_ENV=production vite build`;
await sh(cmd, {
async: true,
nopipe: true,
@@ -23,7 +23,7 @@ export const runBuild = async (preview = false) => {
if (!argvList.includes('no-conf')) {
await runBuildConfig();
}
await runUpdateHtml();
// await runUpdateHtml();
if (!preview) {
await startGzipStyle();
}