Skip to content

Commit

Permalink
update Makefile to include source map in build dir [fixes #1452]
Browse files Browse the repository at this point in the history
  • Loading branch information
hargasinski committed Jul 21, 2017
1 parent 0040c54 commit b5b22fb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Makefile
Expand Up @@ -20,6 +20,7 @@ LINT_FILES = lib/ mocha_test/ $(shell find perf/ -maxdepth 2 -type f) $(shell fi

UMD_BUNDLE = $(BUILDDIR)/dist/async.js
UMD_BUNDLE_MIN = $(BUILDDIR)/dist/async.min.js
UMD_BUNDLE_MAP = $(BUILDDIR)/dist/async.min.map
ES_MODULES = $(patsubst lib/%.js, build-es/%.js, $(JS_SRC))
CJS_MODULES = $(patsubst lib/%.js, build/%.js, $(JS_SRC))

Expand Down Expand Up @@ -53,24 +54,29 @@ $(UMD_BUNDLE): $(ES_MODULES) package.json
node $(SCRIPTS)/build/aggregate-bundle.js

# Create the minified UMD versions and copy them to dist/ for bower
build-dist: $(DIST) $(UMD_BUNDLE) $(UMD_BUNDLE_MIN) $(DIST)/async.js $(DIST)/async.min.js
build-dist: $(DIST) $(UMD_BUNDLE) $(UMD_BUNDLE_MIN) $(DIST)/async.js $(DIST)/async.min.js $(DIST)/async.min.map

$(DIST):
mkdir -p $@

$(UMD_BUNDLE_MIN): $(UMD_BUNDLE)
mkdir -p "$(@D)"
$(UGLIFY) $< --mangle --compress \
--source-map $(DIST)/async.min.map \
--source-map $(UMD_BUNDLE_MAP) \
--source-map-url async.min.map \
-o $@

$(UMD_BUNDLE_MAP): $(UMD_BUNDLE_MIN)

$(DIST)/async.js: $(UMD_BUNDLE)
cp $< $@

$(DIST)/async.min.js: $(UMD_BUNDLE_MIN)
cp $< $@

$(DIST)/async.min.map: $(UMD_BUNDLE_MAP)
cp $< $@

build-es: $(ES_MODULES)

$(BUILD_ES)/%.js: lib/%.js
Expand Down

0 comments on commit b5b22fb

Please sign in to comment.