File tree Expand file tree Collapse file tree 1 file changed +29
-7
lines changed Expand file tree Collapse file tree 1 file changed +29
-7
lines changed Original file line number Diff line number Diff line change @@ -7,20 +7,42 @@ ensure_bash_4
7
7
shopt -s globstar
8
8
9
9
# # Delete the dist folder
10
- rm -rf dist
10
+ # rm -rf dist
11
11
12
12
echo -e " \033[0;36m🏗️ Building Glide Data Grid 🏗️\033[0m"
13
13
14
+ compile () {
15
+ tsc -p tsconfig.$1 .json --outdir ./dist/$1 -tmp --declarationDir ./dist/dts-tmp
16
+ linaria -r dist/$1 -tmp/ -m esnext -o dist/$1 -tmp/ dist/$1 -tmp/** /* .js -t -i dist/$1 -tmp -c ../../config/linaria.json > /dev/null
17
+ remove_all_css_imports dist/$1 -tmp
18
+
19
+ # replace dist/$1 (if it exists) with dist/$1-tmp
20
+ if [ -d " dist/$1 " ]; then
21
+ mv dist/$1 dist/$1 -remove
22
+ rm -rf dist/$1 -remove &
23
+ fi
24
+ mv dist/$1 -tmp dist/$1
25
+
26
+
27
+
28
+ # if it's esm, move the dts folder
29
+ if [ " $2 " = true ]; then
30
+ if [ -d " dist/dts" ]; then
31
+ mv dist/dts dist/dts-remove
32
+ rm -rf dist/dts-remove &
33
+ fi
34
+ mv dist/dts-tmp dist/dts
35
+ fi
36
+
37
+ rm dist/tsconfig.$1 .tsbuildinfo
38
+ }
39
+
14
40
compile_esm () {
15
- tsc -p tsconfig.esm.json
16
- linaria -r dist/esm/ -m esnext -o dist/esm/ dist/esm/** /* .js -t -i dist/esm -c ../../config/linaria.json > /dev/null
17
- remove_all_css_imports dist/esm
41
+ compile esm true
18
42
}
19
43
20
44
compile_cjs () {
21
- tsc -p tsconfig.cjs.json
22
- linaria -r dist/cjs/ -m commonjs -o dist/cjs/ dist/cjs/** /* .js -t -i dist/cjs -c ../../config/linaria.json > /dev/null
23
- remove_all_css_imports dist/cjs
45
+ compile cjs false
24
46
}
25
47
26
48
run_in_parallel compile_esm compile_cjs
You can’t perform that action at this time.
0 commit comments