Created
December 5, 2015 16:35
-
-
Save yadomi/52d5e1b613b49cb51255 to your computer and use it in GitHub Desktop.
Simple Makefile for easy ES6 transpilation with babel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LIBS := $(wildcard lib/*.js) | |
SOURCE_JS := inject.es6 | |
BUILD_JS := dist/inject.min.js | |
SOURCE_CSS := inject.css | |
BUILD_CSS := dist/inject.min.css | |
UGLIFYJS := ./node_modules/uglify-js/bin/uglifyjs | |
BABEL := ./node_modules/babel-cli/bin/babel.js | |
all: $(BUILD_JS) $(BUILD_CSS) | |
/tmp/inject.js: $(SOURCE_JS) | |
$(BABEL) $? --source-maps inline --out-file $@ | |
$(BUILD_JS): $(LIBS) /tmp/inject.js | |
$(UGLIFYJS) --compress --mangle -- $^ > $(BUILD_JS) | |
$(BUILD_CSS): $(SOURCE_CSS) | |
minify inject.css > dist/inject.min.css |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment