Skip to content

Commit 84b19d7

Browse files
committed
add preview
1 parent 2f73100 commit 84b19d7

File tree

3 files changed

+49
-13
lines changed

3 files changed

+49
-13
lines changed

build/index.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const { run } = require('runjs')
2+
const chalk = require('chalk')
3+
const config = require('../vue.config.js')
4+
const rawArgv = process.argv.slice(2)
5+
const args = rawArgv.join(' ')
6+
7+
if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
8+
run(`vue-cli-service build ${args}`)
9+
10+
const port = 9526
11+
const basePath = config.baseUrl
12+
13+
var connect = require('connect')
14+
var serveStatic = require('serve-static')
15+
const app = connect()
16+
17+
app.use(
18+
basePath,
19+
serveStatic('./dist', {
20+
index: ['index.html', '/']
21+
})
22+
)
23+
24+
app.listen(port, function() {
25+
console.log(
26+
chalk.green(`> Listening at http://localhost:${port}${basePath}`)
27+
)
28+
})
29+
} else {
30+
run(`vue-cli-service build ${args}`)
31+
}

favicon.ico

-66.1 KB
Binary file not shown.

package.json

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"dev": "vue-cli-service serve",
99
"build:prod": "vue-cli-service build",
1010
"build:sit": "vue-cli-service build --mode text",
11+
"build:preview": "node build/index.js --preview",
12+
"build:report": "node build/index.js --report",
1113
"lint": "eslint --ext .js,.vue src",
1214
"test": "npm run lint",
1315
"test:unit": "vue-cli-service test:unit",
@@ -37,11 +39,11 @@
3739
"dependencies": {
3840
"axios": "0.18.0",
3941
"clipboard": "1.7.1",
40-
"codemirror": "5.39.2",
41-
"driver.js": "0.5.2",
42-
"dropzone": "5.2.0",
42+
"codemirror": "5.42.0",
43+
"driver.js": "0.8.1",
44+
"dropzone": "5.5.1",
4345
"echarts": "4.1.0",
44-
"element-ui": "2.4.6",
46+
"element-ui": "2.4.10",
4547
"file-saver": "1.3.8",
4648
"js-cookie": "2.2.0",
4749
"jsonlint": "1.6.3",
@@ -50,37 +52,40 @@
5052
"nprogress": "0.2.0",
5153
"path-to-regexp": "2.4.0",
5254
"screenfull": "3.3.3",
53-
"showdown": "1.8.6",
5455
"sortablejs": "1.7.0",
5556
"tui-editor": "1.2.7",
5657
"vue": "2.5.17",
5758
"vue-count-to": "1.0.13",
5859
"vue-i18n": "7.3.2",
5960
"vue-router": "3.0.2",
6061
"vue-splitpane": "1.0.2",
61-
"vuedraggable": "^2.16.0",
62+
"vuedraggable": "2.17.0",
6263
"vuex": "3.0.1",
6364
"xlsx": "^0.11.16"
6465
},
6566
"devDependencies": {
6667
"@babel/core": "7.0.0",
6768
"@babel/register": "7.0.0",
68-
"@vue/cli-plugin-babel": "3.1.1",
69-
"@vue/cli-plugin-eslint": "3.1.5",
70-
"@vue/cli-plugin-unit-jest": "3.1.1",
71-
"@vue/cli-service": "3.1.4",
69+
"@vue/cli-plugin-babel": "3.2.0",
70+
"@vue/cli-plugin-eslint": "3.2.1",
71+
"@vue/cli-plugin-unit-jest": "3.2.0",
72+
"@vue/cli-service": "3.2.0",
7273
"@vue/test-utils": "1.0.0-beta.25",
7374
"babel-core": "7.0.0-bridge.0",
7475
"babel-jest": "23.6.0",
76+
"chalk": "^2.4.1",
77+
"connect": "^3.6.6",
7578
"husky": "0.14.3",
7679
"lint-staged": "7.2.2",
7780
"mockjs": "1.0.1-beta3",
7881
"node-sass": "^4.9.0",
82+
"runjs": "^4.3.2",
7983
"sass-loader": "7.0.3",
80-
"script-ext-html-webpack-plugin": "2.0.1",
84+
"script-ext-html-webpack-plugin": "2.1.3",
8185
"script-loader": "0.7.2",
82-
"svg-sprite-loader": "3.8.0",
83-
"svgo": "1.0.5",
86+
"serve-static": "^1.13.2",
87+
"svg-sprite-loader": "4.1.3",
88+
"svgo": "1.1.1",
8489
"vue-template-compiler": "2.5.17"
8590
},
8691
"engines": {

0 commit comments

Comments
 (0)