summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2016-01-21 16:09:23 -0800
committerAlexander Early <alexander.early@gmail.com>2016-01-21 16:09:23 -0800
commitf7abefd814910f69414f96cd342722969a663402 (patch)
treef39ea6a1d81f155f2d56f0d50e193f0aef61b836 /Makefile
parenta191cb4a07a271dd735b5de5438724dc5557e86b (diff)
downloadasync-f7abefd814910f69414f96cd342722969a663402.tar.gz
add es modules to build, with lodash replaced with lodash-es
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 14 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 8d98a92..f4810e4 100644
--- a/Makefile
+++ b/Makefile
@@ -14,12 +14,14 @@ BUILDDIR = build
DIST = dist
SRC = lib/index.js
SCRIPTS = ./support
-JS_SRC = $(shell find lib/ -type f -name '*.js') package.json
+JS_SRC = $(shell find lib/ -type f -name '*.js')
LINT_FILES = lib/ test/ mocha_test/ $(shell find perf/ -maxdepth 2 -type f) support/ gulpfile.js karma.conf.js
UMD_BUNDLE = $(BUILDDIR)/async.js
UMD_BUNDLE_MIN = $(BUILDDIR)/async.min.js
CJS_BUNDLE = $(BUILDDIR)/index.js
+ES_MODULES = $(patsubst lib/%.js, build/es/%.js, $(JS_SRC))
+
all: lint test clean build
@@ -40,17 +42,17 @@ build-bundle: build-modules $(UMD_BUNDLE) $(CJS_BUNDLE)
build-modules:
$(BABEL_NODE) $(SCRIPTS)/build/modules-cjs.js
-$(UMD_BUNDLE): $(JS_SRC)
+$(UMD_BUNDLE): $(JS_SRC) package.json
$(BABEL_NODE) $(SCRIPTS)/build/aggregate-bundle.js
-$(CJS_BUNDLE): $(JS_SRC)
+$(CJS_BUNDLE): $(JS_SRC) package.json
$(BABEL_NODE) $(SCRIPTS)/build/aggregate-cjs.js
# Create the minified UMD versions and copy them to dist/ for bower
build-dist: $(DIST) $(DIST)/async.js $(DIST)/async.min.js $(UMD_BUNDLE_MIN)
$(DIST):
- mkdir -p $(DIST)/
+ mkdir -p $@
$(UMD_BUNDLE_MIN): $(UMD_BUNDLE)
$(UGLIFY) $< --mangle --compress \
@@ -63,12 +65,18 @@ $(DIST)/async.js: $(UMD_BUNDLE)
$(DIST)/async.min.js: $(UMD_BUNDLE_MIN)
cp $< $@
+build-es: $(ES_MODULES)
+
+$(BUILDDIR)/es/%.js: lib/%.js
+ mkdir -p "$(@D)"
+ sed -r "s/(import.+)lodash/\1lodash-es/g" $< > $@
+
test-build:
mocha support/build.test.js
-.PHONY: build-modules build-bundle build-dist test-build
+.PHONY: build-modules build-bundle build-dist build-es test-build
-build: clean build-bundle build-dist test-build
+build: clean build-bundle build-dist build-es test-build
.PHONY: test lint build all clean