3 files changed +30
-33
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,33 @@ remove_all_css_imports() {
43
43
sed_cmd=" sed -i ''" # BSD sed
44
44
fi
45
45
46
- find " $directory " -type f -name " *.js" -exec bash -c " $sed_cmd \" /require('.\/.*\.css');/d\" {}" \;
46
+ # find "$directory" -type f -name "*.js" -exec bash -c "$sed_cmd \"/require('.\/.*\.css');/d\" {}" \;
47
+ # find "$directory" -type f -name "*.js" -exec bash -c "$sed_cmd \"/require('.\/.*\.css');/d;/import \\\".*\.css\\\";/d\" {}" \;
47
48
find " $directory " -type f -name " *.js" -exec bash -c " $sed_cmd \" /import \\\" .*\.css\\\" ;/d\" {}" \;
49
+ }
50
+
51
+ compile () {
52
+ tsc -p tsconfig.$1 .json --outdir ./dist/$1 -tmp --declarationDir ./dist/dts-tmp
53
+ 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
54
+ remove_all_css_imports dist/$1 -tmp
55
+
56
+ # replace dist/$1 (if it exists) with dist/$1-tmp
57
+ if [ -d " dist/$1 " ]; then
58
+ mv dist/$1 dist/$1 -remove
59
+ rm -rf dist/$1 -remove &
60
+ fi
61
+ mv dist/$1 -tmp dist/$1
62
+
63
+
64
+
65
+ # if it's esm, move the dts folder
66
+ if [ " $2 " = true ]; then
67
+ if [ -d " dist/dts" ]; then
68
+ mv dist/dts dist/dts-remove
69
+ rm -rf dist/dts-remove &
70
+ fi
71
+ mv dist/dts-tmp dist/dts
72
+ fi
73
+
74
+ rm dist/tsconfig.$1 .tsbuildinfo
48
75
}
Original file line number Diff line number Diff line change @@ -12,15 +12,11 @@ rm -rf dist
12
12
echo -e " \033[0;36m🏗️ Building Glide Data Grid Cells 🏗️\033[0m"
13
13
14
14
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
15
+ compile esm true
18
16
}
19
17
20
18
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
19
+ compile cjs false
24
20
}
25
21
26
22
run_in_parallel compile_esm compile_cjs
Original file line number Diff line number Diff line change @@ -11,32 +11,6 @@ shopt -s globstar
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
-
40
14
compile_esm () {
41
15
compile esm true
42
16
}
0 commit comments