#!/bin/bash

npm install -g modclean

npm install
npm run build

# Creating a new folder to deploy minimum requirement files.
mkdir production-app
cp -r bin/ dist/ LICENSE package.json README.md production-app/

# Cleaning up unnecessary files.
cd production-app/
npm install --only=prod --ignore-scripts
npm prune --production
rm -rf node_modules/*/test/ node_modules/*/tests/
modclean -n default:safe --run
npm uninstall -g modclean
npm cache clean --force
