-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
build.sh
48 lines (40 loc) · 1.84 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# This project us published using https://github.com/atapas/react-package-publisher
#*************************************************
#******* Check Node, NPM and Yarn Versions *******
#*************************************************
echo "Node version: `node -v`"
echo "NPM version: `npm -v`"
echo "Yarn version: `yarn -v`"
#******* Remove the existing dist folder ******
rm -rf dist
#******* Remove the existing index.js file ******
rm -rf index.js
#******* Perform yarn install(Dependency Management) ******
yarn install
#************************************************************************
#******* Build Components => create index.js file and dist folder *******
#************************************************************************
yarn build_component
yarn build
#******************************************************
#******* Copy other required files to the dist folder *******
#******************************************************
cp ./package.json ./dist
[ -f README.md ] && cp ./README.md ./dist
[ -f *.scss ] && cp ./*.scss ./dist/
#******************************************************
#******* Create a tarball npm for local testing *******
#******************************************************
cd dist
# npm pack
cd ..
#*****************************************************************************************
#******* Login and Publish => There are 2 ways to login*******
# 1. Using non interactive mode => Uncomment the line starts with npm-login-noninteractive
# and edit the required parameter values like, <USER_NAME>, <PASSWORD> and <EMAIL>
# 2. Using Intercative mode(Default) => npm login will ask for username, password and email
#******************************************************************************************
# npm-login-noninteractive -u <USER_NAME> -p <PASSWORD> -e <EMAIL>
npm login
yarn publish ./dist