first commit
This commit is contained in:
41
build/Makefile
Normal file
41
build/Makefile
Normal file
@@ -0,0 +1,41 @@
|
||||
SRC_FOLDER=$(CURDIR)/../src
|
||||
RES_FOLDER=$(CURDIR)/../res
|
||||
|
||||
TS_BUILD=tsbuild
|
||||
TS_FLAGS=-da -n -m -od ../build/$(TS_BUILD) # has to be relative for some reason
|
||||
|
||||
LESS_FILE=$(RES_FOLDER)/main.less
|
||||
PY_FILE=$(SRC_FOLDER)/main.py
|
||||
HTML_FILE=$(RES_FOLDER)/main.html
|
||||
|
||||
.PHONY: all transcrypt $(LESS_FILE) $(PY_FILE) $(HTML_FILE)
|
||||
|
||||
|
||||
# mypy:
|
||||
# mypy src/main.py
|
||||
|
||||
all: main.css bundle.js main.html
|
||||
|
||||
transcrypt: $(PY_FILE) $(TS_BUILD)
|
||||
# ln -s $(TS_BUILD) $(SRC_FOLDER)/__target__
|
||||
transcrypt $(TS_FLAGS) $<
|
||||
# rm $(SRC_FOLDER)/__target__
|
||||
|
||||
bundle.js: transcrypt
|
||||
node browserify.js $(TS_BUILD)/main.js > bundle.js
|
||||
|
||||
main.css: $(LESS_FILE)
|
||||
lessc $< > $@
|
||||
|
||||
$(TS_BUILD):
|
||||
mkdir -p $(TS_BUILD)
|
||||
|
||||
main.html: $(HTML_FILE)
|
||||
cp $(RES_FOLDER)/main.html ./
|
||||
|
||||
clean:
|
||||
rm -r $(TS_BUILD)
|
||||
rm bundle.js main.html main.css
|
||||
|
||||
|
||||
|
||||
11
build/browserify.js
Normal file
11
build/browserify.js
Normal file
@@ -0,0 +1,11 @@
|
||||
var browserify = require('browserify');
|
||||
var esmify = require('esmify');
|
||||
|
||||
var bundler = browserify({
|
||||
debug: true,
|
||||
paths: ["../node_modules/snabbdom/"],
|
||||
plugin: [esmify]
|
||||
});
|
||||
|
||||
bundler.add(process.argv[2]);
|
||||
bundler.bundle().pipe(process.stdout);
|
||||
Reference in New Issue
Block a user