From e98eabb55462f5ff3419c17a3a39e70900fcc391 Mon Sep 17 00:00:00 2001 From: NatureFreshMilk Date: Thu, 19 Sep 2019 11:51:55 +0200 Subject: [PATCH] rollup in the relase build --- Makefile | 8 ++++++-- docker_builder/Dockerfile | 3 +++ static/js/rollup.config.js | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 529bf21..47d69fa 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ BINARIES += $(OUT_DIR)/mapserver-windows-x86.exe BINARIES += $(OUT_DIR)/mapserver-windows-x86-64.exe BINARIES += $(OUT_DIR)/mapserver-linux-arm +JS_BUNDLE = static/js/bundle.js all: $(STATIC_VFS) go build @@ -32,13 +33,16 @@ test: $(OUT_DIR) $(ENV) go test ./... clean: - rm -rf $(STATIC_VFS) test-output + rm -rf $(STATIC_VFS) $(JS_BUNDLE) test-output rm -rf $(OUT_DIR) jshint: jshint static/js/*.js static/js/components static/js/map static/js/util -$(STATIC_VFS): +$(JS_BUNDLE): + cd static/js && rollup -c rollup.config.js + +$(STATIC_VFS): $(JS_BUNDLE) go generate $(OUT_DIR)/mapserver-linux-x86_64: $(OUT_DIR) diff --git a/docker_builder/Dockerfile b/docker_builder/Dockerfile index c8ae46c..a5c75db 100644 --- a/docker_builder/Dockerfile +++ b/docker_builder/Dockerfile @@ -17,3 +17,6 @@ RUN luarocks install luacheck # jshint RUN apt-get install -y nodejs npm RUN npm install -g jshint + +# rollup +RUN npm install -g rollup diff --git a/static/js/rollup.config.js b/static/js/rollup.config.js index 6ece635..bc5416a 100644 --- a/static/js/rollup.config.js +++ b/static/js/rollup.config.js @@ -1,5 +1,5 @@ -module.exports = { +export default { input: 'main.js', output: { file :'bundle.js',