Move rollup.js configuration into own config file

This commit is contained in:
Carsten Grohmann 2021-12-26 23:03:04 +01:00
parent ca2d1c899f
commit ef045232d1
3 changed files with 19 additions and 5 deletions

View File

@ -22,14 +22,14 @@ TEST_FILE = $(BASE_DIR)/test.py
VERSION = 0.5.0 VERSION = 0.5.0
RELEASE_DIR = $(BASE_DIR)/release RELEASE_DIR = $(BASE_DIR)/release
RELEASE_FILES = $(HTML_FILE) $(JS_OUT_FILE) $(PY_SOURCE) $(TEST_FILE ) Makefile requirements.txt LICENSE.txt \ RELEASE_FILES = $(HTML_FILE) $(JS_OUT_FILE) $(PY_SOURCE) $(TEST_FILE ) rollup.config.js Makefile requirements.txt \
README.md LICENSE.txt README.md
RELEASE_INST_DIR = $(RELEASE_DIR)/OOMAnalyser-$(VERSION) RELEASE_INST_DIR = $(RELEASE_DIR)/OOMAnalyser-$(VERSION)
RELEASE_TARGZ = OOMAnalyser-$(VERSION).tar.gz RELEASE_TARGZ = OOMAnalyser-$(VERSION).tar.gz
RELEASE_ZIP = OOMAnalyser-$(VERSION).zip RELEASE_ZIP = OOMAnalyser-$(VERSION).zip
ROLLUP_BIN = rollup ROLLUP_BIN = rollup
ROLLUP_OPTS = --format=umd --name OOMAnalyser --file=${JS_OUT_FILE} ROLLUP_OPTS = --config rollup.config.js
TRANSCRYPT_BIN = transcrypt TRANSCRYPT_BIN = transcrypt
TRANSCRYPT_OPTS = --build --map --nomin --sform --esv 6 TRANSCRYPT_OPTS = --build --map --nomin --sform --esv 6
@ -88,7 +88,7 @@ ${JS_TEMP_FILE}: $(VIRTUAL_ENV_DIR)/bin/activate ${PY_SOURCE}
${JS_OUT_FILE}: $(VIRTUAL_ENV_DIR)/bin/activate ${JS_TEMP_FILE} ${JS_OUT_FILE}: $(VIRTUAL_ENV_DIR)/bin/activate ${JS_TEMP_FILE}
. $(VIRTUAL_ENV_DIR)/bin/activate . $(VIRTUAL_ENV_DIR)/bin/activate
$(ROLLUP_BIN) $(ROLLUP_OPTS) -- ${JS_TEMP_FILE} $(ROLLUP_BIN) $(ROLLUP_OPTS)
#+ Compile Python to JavaScript #+ Compile Python to JavaScript
build: $(VIRTUAL_ENV_DIR)/bin/activate ${JS_OUT_FILE} build: $(VIRTUAL_ENV_DIR)/bin/activate ${JS_OUT_FILE}

View File

@ -63,7 +63,7 @@ or
``` ```
# . env/bin/activate # . env/bin/activate
# transcrypt --build --map --nomin -e 6 OOMAnalyser.py # transcrypt --build --map --nomin -e 6 OOMAnalyser.py
# rollup --format=umd --name OOMAnalyser --file=OOMAnalyser.js -- __target__/OOMAnalyser.js # rollup --config rollup.config.js
or or

14
rollup.config.js Normal file
View File

@ -0,0 +1,14 @@
// Rollup.js configuration for OOMAnalyser
//
// Copyright (c) 2017-2021 Carsten Grohmann
// License: MIT (see LICENSE.txt)
// THIS PROGRAM COMES WITH NO WARRANTY
export default {
input: '__target__/OOMAnalyser.js',
output: {
file: 'OOMAnalyser.js',
name: 'OOMAnalyser',
format: 'umd'
}
};