Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. # remove this file whenever you don't need it. you need json package to execute the last part.
  3. echo 'installing npm dependencies...'
  4. npm i -s react react-dom prop-types react-hot-loader
  5. echo 'installing npm devDependencies...'
  6. npm i -D @babel/cli @babel/core @babel/plugin-syntax-dynamic-import @babel/preset-env @babel/preset-react babel-loader clean-webpack-plugin html-webpack-plugin webpack webpack-cli webpack-dev-server
  7. echo 'add scripts to package.json...'
  8.  
  9. json -f package.json -I -e "this.scripts.start=\"NODE_ENV=development webpack-dev-server --open\""
  10. json -f package.json -I -e "this.scripts.build=\"NODE_ENV=production webpack\""
  11. json -f package.json -I -e "this.scripts.stats=\"webpack --mode production --profile --json > stats.json\""
  12. json -f package.json -I -e "this.scripts.clean=\"rm -rf node_modules/ && rm -rf dist/\""
  13. json -f package.json -I -e "this.browserslist=[\"> 1\%\"]"
  14. echo 'move index.html and index.js to src'
  15. mkdir src
  16. mv index.* src
  17. if command -v gsed &> /dev/null; then
  18. gsed -i '1d' src/index.*
  19. fi
  20. echo 'Done. Using follow command to change the permission of all files'
  21. echo ''
  22. echo ' sudo chmod 644 *.* src/*.*'
  23. echo ''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement