From 84b19d7283d96a2ee339cf46352effed93be28bb Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 28 Nov 2018 18:11:18 +0800 Subject: [PATCH] add preview --- build/index.js | 31 +++++++++++++++++++++++++++++++ favicon.ico | Bin 67646 -> 0 bytes package.json | 31 ++++++++++++++++++------------- 3 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 build/index.js delete mode 100644 favicon.ico diff --git a/build/index.js b/build/index.js new file mode 100644 index 00000000..a750ae0b --- /dev/null +++ b/build/index.js @@ -0,0 +1,31 @@ +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')) { + run(`vue-cli-service build ${args}`) + + const port = 9526 + const basePath = config.baseUrl + + var connect = require('connect') + var serveStatic = require('serve-static') + const app = connect() + + app.use( + basePath, + serveStatic('./dist', { + index: ['index.html', '/'] + }) + ) + + app.listen(port, function() { + console.log( + chalk.green(`> Listening at http://localhost:${port}${basePath}`) + ) + }) +} else { + run(`vue-cli-service build ${args}`) +} diff --git a/favicon.ico b/favicon.ico deleted file mode 100644 index 34b63ac63a87ee3ea8e7a0f3f5b5406c437e2112..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67646 zcmeHQ33wdEm2O$a2gEi66S8a^!){2(X2Y@}*zze`)?rJU(MUFiMYeol`2frK#KsuO zmSjtF$~K2NVhlNfB)}R7SkfFaCWOr{`-RN#4YIW(H- zo|aUj@2RJ{r>m>p|LWDNSFfrSr2u~|Eeif$u3R;tK>3)WC|7}SiYLW+e&x3_lNCW) zTK<C+ zR1SCpF}#VnD^NAY(^oSQ_)Y=-Q*rK69RC8x%Ygl*pi6-NM{#|U$L|<_q}x%@6|58T zLYZ(QKeyk8bhWAVkPjO?2iki|(6)h5$e}pLQj0&7qVaE>Z7c&zo=1K1Eq%6 zPiCH&1BdlEaj^n`p2H2XH-4&`R zaKVOzju8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?EGo#ZDs9N=8R&euxOe~R%T{UkpI4F$WQ-b4TNX^;>4Xcfk4SG)XG zSl_CR*}DAJi?_=S=dF{A@D+pKt{$voM!XZ^AH3lITcDw0n(DsaAYb|+I6q0fQ;IhI z*PX%2v9#ehR(HcEFF)pU0P8)3j>TAUGWuBVHMa%Cwn@EAUn*lH*heH9H}E|D?EDRX z%RQ>-kD)#}1#)8C!MKDX$k?ZV^M%J=s;A!3bb1hTufufC-F&2sd!iQ@h%q!{NkTQ} zp%0$w4m#jFcdP?JFW8>|etp306%c)GJiY{ZLHxP>5qx)IOtux@?VziX{!1J$Mm`rD zdSUq(AKEzkaoNs|!!Q>)yZw02F>wM_oVXiyVr?Pt=e`pYaDF1rGu}8#z#p-P_VK`e z9DHwMy@Bd6zB3$`GY_#&4Y5hJ%HiPBTog~{VIl`y7%z&L5)oGtZogsK(C`)e5kzsO z@6|(nj(%MBFqYOb(5k~swGzeBT8Uz5tx8&TMIl6ny7Y8DK$jL7hO5sTL;~ zlvtnU1N7C!QI(h$xxtqM^J|3iKI-A_RE*W=R^fEL{kfJe%7F|G%7zi&qR zT#7U<>j8-u*!VQ%P2T`mJbijP(>jJ0$EBN@)-ixd9Rsum8LObkURU8_@$*;(o3(VL zg5lev6(TeFiAY>HyJ&&6tI-0B%JE#dfRUd^3RoQZeYk+pq*kEl?O~2I$F7qjy2~QN X;@D+E7Ad=S_FbjlW&KY_+xPzm3MBT? diff --git a/package.json b/package.json index 09487f42..84bc63c4 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "dev": "vue-cli-service serve", "build:prod": "vue-cli-service build", "build:sit": "vue-cli-service build --mode text", + "build:preview": "node build/index.js --preview", + "build:report": "node build/index.js --report", "lint": "eslint --ext .js,.vue src", "test": "npm run lint", "test:unit": "vue-cli-service test:unit", @@ -37,11 +39,11 @@ "dependencies": { "axios": "0.18.0", "clipboard": "1.7.1", - "codemirror": "5.39.2", - "driver.js": "0.5.2", - "dropzone": "5.2.0", + "codemirror": "5.42.0", + "driver.js": "0.8.1", + "dropzone": "5.5.1", "echarts": "4.1.0", - "element-ui": "2.4.6", + "element-ui": "2.4.10", "file-saver": "1.3.8", "js-cookie": "2.2.0", "jsonlint": "1.6.3", @@ -50,7 +52,6 @@ "nprogress": "0.2.0", "path-to-regexp": "2.4.0", "screenfull": "3.3.3", - "showdown": "1.8.6", "sortablejs": "1.7.0", "tui-editor": "1.2.7", "vue": "2.5.17", @@ -58,29 +59,33 @@ "vue-i18n": "7.3.2", "vue-router": "3.0.2", "vue-splitpane": "1.0.2", - "vuedraggable": "^2.16.0", + "vuedraggable": "2.17.0", "vuex": "3.0.1", "xlsx": "^0.11.16" }, "devDependencies": { "@babel/core": "7.0.0", "@babel/register": "7.0.0", - "@vue/cli-plugin-babel": "3.1.1", - "@vue/cli-plugin-eslint": "3.1.5", - "@vue/cli-plugin-unit-jest": "3.1.1", - "@vue/cli-service": "3.1.4", + "@vue/cli-plugin-babel": "3.2.0", + "@vue/cli-plugin-eslint": "3.2.1", + "@vue/cli-plugin-unit-jest": "3.2.0", + "@vue/cli-service": "3.2.0", "@vue/test-utils": "1.0.0-beta.25", "babel-core": "7.0.0-bridge.0", "babel-jest": "23.6.0", + "chalk": "^2.4.1", + "connect": "^3.6.6", "husky": "0.14.3", "lint-staged": "7.2.2", "mockjs": "1.0.1-beta3", "node-sass": "^4.9.0", + "runjs": "^4.3.2", "sass-loader": "7.0.3", - "script-ext-html-webpack-plugin": "2.0.1", + "script-ext-html-webpack-plugin": "2.1.3", "script-loader": "0.7.2", - "svg-sprite-loader": "3.8.0", - "svgo": "1.0.5", + "serve-static": "^1.13.2", + "svg-sprite-loader": "4.1.3", + "svgo": "1.1.1", "vue-template-compiler": "2.5.17" }, "engines": {