build.sh 653 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. # set current working directory to directory of the shell script
  3. cd "$(dirname "$0")"
  4. # before
  5. npm ci 2> /dev/null || npm i
  6. # copy
  7. # https://github.com/mathjax/MathJax#reducing-the-size-of-the-components-directory
  8. # tex-mml-chtml.js
  9. mkdir -p ../../vendor/mathjax
  10. cp node_modules/mathjax/es5/tex-mml-chtml.js ../../vendor/mathjax
  11. # extensions/
  12. mkdir -p ../../vendor/mathjax/extensions
  13. cp node_modules/mathjax/es5/input/tex/extensions/*.js ../../vendor/mathjax/extensions/
  14. # fonts/
  15. mkdir -p ../../vendor/mathjax/fonts
  16. cp node_modules/mathjax/es5/output/chtml/fonts/woff-v2/*.woff ../../vendor/mathjax/fonts
  17. # after
  18. rm -rf node_modules/