Skip to content

Commit

Permalink
fix(sourcemap): provide good url (#3011)
Browse files Browse the repository at this point in the history
When IS.js is inserted with     <script src="https://cdn.jsdelivr.net/npm/instantsearch.js@2"></script>

Then the sourcemap url is not the right one (it was
"instantsearch.min.js.map") now it will be
/dist/instantsearch.min.js.map which will work in every cases.
  • Loading branch information
vvo authored and bobylito committed Jun 26, 2018
1 parent f60222d commit 9632ade
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ mkdir -p dist dist-es5-module es

echo "➡️ Bundle instantsearch.js to UMD build './dist' via webpack"
NODE_ENV=production BABEL_ENV=production webpack --config scripts/webpack.config.js --hide-modules

# https://stackoverflow.com/questions/16745988/sed-command-with-i-option-in-place-editing-works-fine-on-ubuntu-but-not-mac
sed -i.bak 's/sourceMappingURL=instantsearch\.min\.js\.map/sourceMappingURL=\/dist\/instantsearch\.min\.js\.map/g' dist/instantsearch.min.js && rm dist/instantsearch.min.js.bak

csso dist/instantsearch.css dist/instantsearch.min.css --map file &
csso dist/instantsearch-theme-algolia.css dist/instantsearch-theme-algolia.min.css --map file

Expand Down

0 comments on commit 9632ade

Please sign in to comment.