File tree 2 files changed +24
-4
lines changed
2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ node_modules
2
2
package-lock.json
3
3
flowCommon.min.js
4
4
flowCommonWeb.min.js
5
+ generated /
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env ruby
2
2
3
3
puts "Minifying FlowCommonWeb files."
4
+
4
5
flowCommonWebDir = "#{ __dir__ } /Sources/FlowCommonWebFiles"
5
- flowCommonWebFiles = "Track.js Animation.js player.js web-animations.min.js ToggleButton.js"
6
- outputDir = "#{ __dir__ } "
7
- filename = "flowcommon.min.js"
6
+ waapi = "web-animations.min.js"
7
+ flowCommonWebFiles = [
8
+ "Track.js" ,
9
+ "Animation.js" ,
10
+ "player.js" ,
11
+ "ToggleButton.js"
12
+ ]
13
+
14
+ outputDir = "#{ __dir__ } /generated"
15
+ system "mkdir #{ outputDir } "
16
+
17
+ flowcommon = "flowcommon.js"
18
+ flowcommonMin = "flowcommon.min.js"
19
+ flowcommonWaapiMin = "flowcommon-waapi.min.js"
20
+
21
+ puts "Creating flowcommon.js"
22
+ abort unless system "cd #{ flowCommonWebDir } && uglifyjs #{ flowCommonWebFiles . join ( ' ' ) } --beautify --output #{ outputDir } /#{ flowcommon } "
23
+
24
+ puts "Creating flowcommon.min.js"
25
+ abort unless system "cd #{ flowCommonWebDir } && uglifyjs #{ flowCommonWebFiles . join ( ' ' ) } --compress --output #{ outputDir } /#{ flowcommonMin } "
8
26
9
- abort unless system "cd #{ flowCommonWebDir } && uglifyjs #{ flowCommonWebFiles } --compress --output #{ outputDir } /#{ filename } "
27
+ puts "Creating flowcommon-waapi.min.js"
28
+ abort unless system "cd #{ flowCommonWebDir } && uglifyjs #{ flowCommonWebFiles . join ( ' ' ) } #{ waapi } --compress --output #{ outputDir } /#{ flowcommonWaapiMin } "
10
29
11
30
puts "Successfully Minified FlowCommonWeb files!"
You can’t perform that action at this time.
0 commit comments