add webpack for lib

This commit is contained in:
peter
2019-08-19 16:57:46 +02:00
parent 60d0bbc4f1
commit 1d29ed4746
4 changed files with 7 additions and 6 deletions
-3
View File
@@ -1,3 +0,0 @@
[submodule "src/frontend/dashboard"]
path = src/frontend/dashboard
url = https://gitea.frontblock.me/fb-vendor/dashboard.git
+2 -2
View File
@@ -5,14 +5,14 @@
"scripts": { "scripts": {
"tsc": "tsc", "tsc": "tsc",
"start": "npm run build; node lib/FrontblockAdmin.js", "start": "npm run build; node lib/FrontblockAdmin.js",
"build": "npm run clean; npm run build-backend;", "build": "npm run clean; npm run build-backend; npm run webpack",
"build-backend": "tsc; webpack --display-error-details --config src/backend/webpack.prod.js --progress --colors;", "build-backend": "tsc; webpack --display-error-details --config src/backend/webpack.prod.js --progress --colors;",
"build-frontend": "npm run build-dashboard", "build-frontend": "npm run build-dashboard",
"build-dashboard": "git submodule init && git submodule update --merge; cd src/frontend/dashboard; npm i && npm run build; cp -r dist/* ../../../static", "build-dashboard": "git submodule init && git submodule update --merge; cd src/frontend/dashboard; npm i && npm run build; cp -r dist/* ../../../static",
"build-widget": "rollup -c src/frontend/widget/rollup.config.js; mkdir -p plugins/PluginManager; cp FrontendPlugin.js plugins/PluginManager", "build-widget": "rollup -c src/frontend/widget/rollup.config.js; mkdir -p plugins/PluginManager; cp FrontendPlugin.js plugins/PluginManager",
"clean": "rm -rf lib static plugins data conf dist widget .rpt2_cache *.js *.ts src/frontend/dashboard/dist", "clean": "rm -rf lib static plugins data conf dist widget .rpt2_cache *.js *.ts src/frontend/dashboard/dist",
"update-frontblock": "rm -rf node_modules/frontblock*; npm install", "update-frontblock": "rm -rf node_modules/frontblock*; npm install",
"webpack": "webpack --entry ./lib/FrontblockLib.js --output ./FrontblockLib.min.js" "webpack": "webpack --mode production --entry ./lib/FrontblockLib.js --output ./lib/FrontblockLib.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
+5
View File
@@ -82,6 +82,10 @@ export class FrontblockAdmin extends ConfigLoader<AdminConf>{
return {httpPort: 8080} return {httpPort: 8080}
} }
private async updateFrontblockLib(){
await (new FrontblockCherryPicker("fb-dist/admin", "master", "FrontblockLib.js")).write("./static/FrontblockLib.js")
}
private async updateDashboard(){ private async updateDashboard(){
const dashboard = new GitUpdater("./static") const dashboard = new GitUpdater("./static")
const status = await dashboard.cloneRepo("https://gitea.frontblock.me/fb-dist/dashboard.git", true) const status = await dashboard.cloneRepo("https://gitea.frontblock.me/fb-dist/dashboard.git", true)
@@ -96,6 +100,7 @@ export class FrontblockAdmin extends ConfigLoader<AdminConf>{
private async initialize(){ private async initialize(){
await this.updateDashboard() await this.updateDashboard()
await this.updateFrontblockLib()
await this.updatePluginmanager() await this.updatePluginmanager()
let str = "../plugins/PluginManager/Plugin" let str = "../plugins/PluginManager/Plugin"