From 598e499ed230767f4bec5334aa59191fcfc9fc65 Mon Sep 17 00:00:00 2001 From: knoxfighter Date: Sun, 12 Aug 2018 02:24:31 +0200 Subject: [PATCH] added new laravel-mix section to readme --- Makefile | 7 +++++-- README.md | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 59fb13a..5580b90 100644 --- a/Makefile +++ b/Makefile @@ -20,9 +20,9 @@ build/factorio-server-manager-%.zip: app/bundle.js factorio-server-manager-% @zip -r $@ factorio-server-manager > /dev/null @rm -r factorio-server-manager -app/bundle.js: +app/bundle: @echo "Building Frontend" - @cd ui && npm install && npm run build + @npm install && npm run build factorio-server-manager-linux: godeps @echo "Building Backend - Linux" @@ -47,3 +47,6 @@ clean: @echo "Cleaning" @rm -r build/ @rm app/bundle.js + @rm app/bundle.css + @rm app/fonts/vendor + @rm app/images/vendor diff --git a/README.md b/README.md index 02a7712..35f7867 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ make ``` #### Building the React Frontend alone -Frontend is built using React and the AdminLTE CSS framework. See app/dist/ for AdminLTE included files and license. +Frontend is built using React and the AdminLTE CSS framework. The root of the UI application is served at app/index.html. Run the npm build script and the Go application during development to get live rebuilding of the UI code. @@ -116,9 +116,19 @@ All necessary CSS and Javascript files are included for running the UI. Transpiled bundle.js application is output to app/bundle.js, 'npm run build' script starts webpack to build the React application for development. ``` -make app/bundle.js +make app/bundle ``` +##### For development +The frontend is completly build by npm with laravel-mix. All plugins are buld into the compiled files. No plugins need to be load fro external sources. + +It has different variants to build the frontend, provided by laravel-mix: +- `npm run dev` Build the code for development. This will also generate map-files, so the browser, can show, what line and file causes the output. +- `npm run watch` Build the code for development like the dev-command. This will not stop and automatically rebuild, when files are changed and saved. +- `npm run hot` Build the code for development. It has the same behaviour like the watch-command and also causes a hotReload of the files inside the browser (in theory) +- `npm run build` Build the code for deployment. It will generate no map-files and also minifies the bundle-files. +In every of those cases, also images and fonts will be copied to the app-folder. + ### Building for Windows 1. Download the latest release source zip file * [https://github.com/mroote/factorio-server-manager/releases](https://github.com/mroote/factorio-server-manager/releases)