build.sh 490 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. # set current working directory to directory of the shell script
  3. cd "$(dirname "$0")"
  4. # before
  5. npm install
  6. mkdir -p tmp
  7. # mdc.min.js
  8. npx rollup --config rollup.mjs --input mdc.js --file tmp/mdc.js
  9. npx babel tmp/mdc.js --out-file tmp/mdc.min.js
  10. # mdc.min.css
  11. npx node-sass --include-path node_modules/ mdc.scss tmp/mdc.css
  12. npx csso --input tmp/mdc.css --output tmp/mdc.min.css
  13. # copy
  14. cp tmp/mdc.min.* ../../vendor/
  15. # after
  16. rm -r tmp/
  17. rm -rf node_modules/ package-lock.json