Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Makefile to include source map in build dir [fixes #1452] #1453

Merged
merged 1 commit into from
Jul 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
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