一、已完成: 1.完成文件列表的展示、预览、删除、下载(多文件、多目录打包下载) 2.文件、文件夹的上传,大文件、多文件上传、断点续传(在另一台电脑的浏览器可以继续) 二、待完成: * 移动复制文件和文件夹(可拖动) * 文件和文件夹的分享,可设置连接时效 * 文件的收藏和打标签(方便筛选) * 适配手机界面
36 lines
892 B
JavaScript
36 lines
892 B
JavaScript
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}`)
|
|
}
|