From a87d672d543e943e5f2cfbdd24f15975db3cab11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A0=E6=B0=B8=E8=BE=89?= Date: Thu, 14 Jan 2021 12:33:25 +0800 Subject: [PATCH] fix --- .gitignore | 1 + build/index.js | 35 ----------------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 build/index.js diff --git a/.gitignore b/.gitignore index ed4b821..08f8ab1 100644 --- a/.gitignore +++ b/.gitignore @@ -21,5 +21,6 @@ selenium-debug.log *.sln *.local admin-web +build diff --git a/build/index.js b/build/index.js deleted file mode 100644 index 0c57de2..0000000 --- a/build/index.js +++ /dev/null @@ -1,35 +0,0 @@ -const { run } = require('runjs') -const chalk = require('chalk') -const config = require('../vue.config.js') -const rawArgv = process.argv.slice(2) -const args = rawArgv.join(' ') - -if (process.env.npm_config_preview || rawArgv.includes('--preview')) { - const report = rawArgv.includes('--report') - - run(`vue-cli-service build ${args}`) - - const port = 9526 - const publicPath = config.publicPath - - var connect = require('connect') - var serveStatic = require('serve-static') - const app = connect() - - app.use( - publicPath, - serveStatic('./dist', { - index: ['index.html', '/'] - }) - ) - - app.listen(port, function () { - console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) - if (report) { - console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) - } - - }) -} else { - run(`vue-cli-service build ${args}`) -}