-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·48 lines (43 loc) · 1.89 KB
/
build
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
#!/usr/bin/env bash
rm -rf dist .gen
mkdir -p dist .gen
cat src/ldp.ls > .gen/index.ls
cat src/ldpe.ls >> .gen/index.ls
cat src/ldpp.ls >> .gen/index.ls
echo "if module? => module.exports = ldpp else if window? => window.ldpp = ldpp" >> .gen/index.ls
cat src/ldp.ls > .gen/ldp.ls
echo "if module? => module.exports = ldpalette else if window? => window.ldpalette = ldpalette" >> .gen/ldp.ls
cat src/ldpe.ls >> .gen/ldpe.ls
echo "if module? => module.exports = ldpe else if window? => window.ldpe = ldpe" >> .gen/ldpe.ls
cat src/ldpp.ls >> .gen/ldpp.ls
echo "if module? => module.exports = ldpp else if window? => window.ldpp = ldpp" >> .gen/ldpp.ls
echo "Transpiling index.ls..."
./node_modules/.bin/lsc -cp --no-header .gen/index.ls > dist/index.js
echo "Transpiling ldpp.ls..."
./node_modules/.bin/lsc -cp --no-header .gen/ldpp.ls > dist/ldpp.js
echo "Transpiling ldpe.ls..."
./node_modules/.bin/lsc -cp --no-header .gen/ldpe.ls > dist/ldpe.js
echo "Transpiling ldp.ls..."
./node_modules/.bin/lsc -cp --no-header .gen/ldp.ls > dist/ldp.js
echo "Transpiling ldpp.styl -> index.css..."
./node_modules/.bin/stylus -p src/ldpp.styl > dist/index.css
echo "Uglifying index.js..."
./node_modules/.bin/uglifyjs dist/index.js -m -c > dist/index.min.js
echo "Uglifying ldpp.js..."
./node_modules/.bin/uglifyjs dist/ldpp.js -m -c > dist/ldpp.min.js
echo "Uglifying ldpe.js..."
./node_modules/.bin/uglifyjs dist/ldpe.js -m -c > dist/ldpe.min.js
echo "Uglifying ldp.js..."
./node_modules/.bin/uglifyjs dist/ldp.js -m -c > dist/ldp.min.js
echo "Uglifying index.css..."
uglifycss dist/index.css > dist/index.min.css
echo "Copy palettes presets to dist/ ..."
cp tool/js/*.js dist/
rm -rf .gen
echo "Copy pug mixin to dist/ ..."
cp src/ldpp.pug dist/
echo "Deploy to web ... "
rm -rf web/static/assets/lib/ldpalettepicker/dev
mkdir -p web/static/assets/lib/ldpalettepicker/dev
cp -R dist/* web/static/assets/lib/ldpalettepicker/dev/
echo "Done."