diff --git a/build/index.js b/build/index.js index 911479e..afae287 100644 --- a/build/index.js +++ b/build/index.js @@ -1,36 +1,6 @@ // https://cli.vuejs.org/zh/guide/build-targets.html const { run } = require('tasksfile') -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 = 9527 - 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}`) -} +run(`vue-cli-service build ${args}`)