Install the project dependencies
npm install
Watches/lints/tests source code after change
npm run build:dev:watch
# update dependencies
$ npm install
# sets up a build folder
$ npm run build
# push build to S3 for Cloudfront distribution
$ aws s3 cp ./dist/i.min.js s3://${S3_BUCKET_NAME}/
$ aws cloudfront create-invalidation --distribution-id ${DISTRIBUTION_ID} --paths /i.min.js
You need to test all functions before build.
To start a test run npm run test:dev
having preinstalled browsers (Chrome, Opera, Safari).
To properly run tests on Safari execute the following command (problem refference):
defaults write com.apple.Safari ApplePersistenceIgnoreState YES
Write your tests using http://nightwatchjs.org/ in tests/e2e folder.
# Install selenium-server-standalone to your system. For example use brew for Mac OS
$ brew install selenium-server-standalone
# run selenium server
$ npm run selenium
# run demo project - required for some tests (npm install should be executed inside to fetch dependencies)
$ npm run serve:demo
# run tests in separate cmd
$ npm run test:e2e