pull/3412/merge
Edwin Betancourt 2024-11-28 00:29:02 +00:00 committed by GitHub
commit c30edb57dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 16 deletions

View File

@ -1,19 +1,15 @@
const { run } = require('runjs')
const chalk = require('chalk')
const config = require('../vue.config.js')
const { sh } = require('tasksfile')
const rawArgv = process.argv.slice(2)
const args = rawArgv.join(' ')
sh(`vue-cli-service build ${args}`)
if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
const report = rawArgv.includes('--report')
run(`vue-cli-service build ${args}`)
const port = 9526
const config = require('../vue.config.js')
const publicPath = config.publicPath
var connect = require('connect')
var serveStatic = require('serve-static')
const connect = require('connect')
const serveStatic = require('serve-static')
const app = connect()
app.use(
@ -23,13 +19,13 @@ if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
})
)
app.listen(port, function () {
const port = 9526
app.listen(port, function() {
const chalk = require('chalk')
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
if (report) {
if (rawArgv.includes('--report')) {
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
}
})
} else {
run(`vue-cli-service build ${args}`)
}

View File

@ -63,13 +63,13 @@
"lint-staged": "8.1.5",
"mockjs": "1.0.1-beta3",
"plop": "2.3.0",
"runjs": "4.3.2",
"sass": "1.26.2",
"sass-loader": "8.0.2",
"script-ext-html-webpack-plugin": "2.1.3",
"serve-static": "1.13.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.0",
"tasksfile": "5.1.1",
"vue-template-compiler": "2.6.10"
},
"browserslist": [