Skip to content

Commit

Permalink
Use Perl to post-process Rollup's output
Browse files Browse the repository at this point in the history
  • Loading branch information
Alhadis committed Mar 14, 2019
1 parent 761b893 commit 07bdc8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ $(ENTRY).js: lib/*/*.mjs lib/*/*/*.mjs
const map = JSON.parse(fs.readFileSync("$@.map", "utf8")); \
delete map.sourcesContent; \
fs.writeFileSync("$@.map", JSON.stringify(map));'
sed -i~ -e "s/await import(/require(/g" $@ && rm -f "$@~"
perl -pi~ -E '\
s/new\s+Array\((\d+)\)/$$1<10?"[".","x$$1."]":$$&/ge; \
s/await import\(/require\(/g;' $@ && rm -f "$@~"
npx terser \
--keep-classnames \
--mangle \
Expand Down

0 comments on commit 07bdc8a

Please sign in to comment.