uglifier 1.3.0 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/ruby.yml +14 -0
- data/.gitignore +44 -0
- data/.gitmodules +10 -1
- data/.rubocop.yml +54 -0
- data/.travis.yml +32 -15
- data/.yardopts +4 -0
- data/CHANGELOG.md +327 -0
- data/CONTRIBUTING.md +47 -0
- data/Gemfile +3 -23
- data/README.md +171 -51
- data/Rakefile +129 -31
- data/lib/es5.js +134 -0
- data/lib/source-map.js +3055 -0
- data/lib/split.js +117 -0
- data/lib/uglifier/version.rb +4 -0
- data/lib/uglifier.js +49 -0
- data/lib/uglifier.rb +458 -103
- data/lib/uglify-harmony.js +432 -0
- data/lib/uglify.js +274 -4680
- data/uglifier.gemspec +27 -60
- metadata +57 -77
- data/VERSION +0 -1
- data/build.js +0 -23
- data/spec/spec_helper.rb +0 -11
- data/spec/uglifier_spec.rb +0 -148
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6eb829d19c603a2d3760e02f0235d9d654f640111734caa9317449378e40fa26
|
4
|
+
data.tar.gz: '0774580cb6353b90d72e5febfdc6777bc05c6d6d773b09e4aab3b82178fe8acd'
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 81f5c10b9dd4b9c84a6fe850dfb45b30bb25e0d9b04fa089ff745683028d1733e6b0b1c92846788af96197ee8774d8a7d105b424bc88f38b0c5abab5971bded0
|
7
|
+
data.tar.gz: 3120b0abc086792140a2cdb3a8ecae725327c8c8ea7b55c49d98be196e97de526087583c5bb2b6a0c169e86277474e8ae8a82d6a02cc23cd58cf0276defff03a
|
data/.gitignore
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# rcov generated
|
2
|
+
coverage
|
3
|
+
|
4
|
+
# rdoc generated
|
5
|
+
rdoc
|
6
|
+
|
7
|
+
# yard generated
|
8
|
+
doc
|
9
|
+
.yardoc
|
10
|
+
|
11
|
+
# bundler
|
12
|
+
.bundle
|
13
|
+
Gemfile.lock
|
14
|
+
gemfiles/*.lock
|
15
|
+
|
16
|
+
# jeweler generated
|
17
|
+
pkg
|
18
|
+
|
19
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
20
|
+
#
|
21
|
+
# * Create a file at ~/.gitignore
|
22
|
+
# * Include files you want ignored
|
23
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
24
|
+
#
|
25
|
+
# After doing this, these files will be ignored in all your git projects,
|
26
|
+
# saving you from having to 'pollute' every project you touch with them
|
27
|
+
#
|
28
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
29
|
+
#
|
30
|
+
# For MacOS:
|
31
|
+
#
|
32
|
+
#.DS_Store
|
33
|
+
#
|
34
|
+
# For TextMate
|
35
|
+
#*.tmproj
|
36
|
+
#tmtags
|
37
|
+
#
|
38
|
+
# For emacs:
|
39
|
+
#*~
|
40
|
+
#\#*
|
41
|
+
#.\#*
|
42
|
+
#
|
43
|
+
# For vim:
|
44
|
+
#*.swp
|
data/.gitmodules
CHANGED
@@ -1,3 +1,12 @@
|
|
1
1
|
[submodule "vendor/uglifyjs"]
|
2
2
|
path = vendor/uglifyjs
|
3
|
-
url = https://github.com/mishoo/
|
3
|
+
url = https://github.com/mishoo/UglifyJS2.git
|
4
|
+
[submodule "vendor/source-map"]
|
5
|
+
path = vendor/source-map
|
6
|
+
url = https://github.com/mozilla/source-map.git
|
7
|
+
[submodule "vendor/split"]
|
8
|
+
path = vendor/split
|
9
|
+
url = https://gist.github.com/2048056.git
|
10
|
+
[submodule "vendor/uglifyjs-harmony"]
|
11
|
+
path = vendor/uglifyjs-harmony
|
12
|
+
url = https://github.com/mishoo/UglifyJS2.git
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
AllCops:
|
2
|
+
DisplayCopNames: true
|
3
|
+
Exclude:
|
4
|
+
- uglifier.gemspec
|
5
|
+
- lib/uglifier/version.rb
|
6
|
+
- "vendor/**/*"
|
7
|
+
- "gemfiles/vendor/**/*"
|
8
|
+
|
9
|
+
Metrics/AbcSize:
|
10
|
+
Max: 20
|
11
|
+
|
12
|
+
Metrics/BlockLength:
|
13
|
+
Enabled: true
|
14
|
+
Exclude:
|
15
|
+
- "spec/**/*_spec.rb"
|
16
|
+
|
17
|
+
Metrics/ClassLength:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
Metrics/LineLength:
|
21
|
+
Max: 100
|
22
|
+
|
23
|
+
Metrics/MethodLength:
|
24
|
+
Max: 20
|
25
|
+
|
26
|
+
Style/Encoding:
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
Style/HashSyntax:
|
30
|
+
EnforcedStyle: hash_rockets
|
31
|
+
|
32
|
+
Style/PercentLiteralDelimiters:
|
33
|
+
Enabled: false
|
34
|
+
|
35
|
+
Style/PreferredHashMethods:
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
Style/SignalException:
|
39
|
+
Enabled: false
|
40
|
+
|
41
|
+
Style/StringLiterals:
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
Style/SymbolArray:
|
45
|
+
Enabled: false
|
46
|
+
|
47
|
+
Style/Alias:
|
48
|
+
Enabled: false
|
49
|
+
|
50
|
+
Style/MutableConstant:
|
51
|
+
Enabled: false
|
52
|
+
|
53
|
+
Style/ExpandPathArguments:
|
54
|
+
Enabled: false
|
data/.travis.yml
CHANGED
@@ -1,18 +1,35 @@
|
|
1
|
+
sudo: false
|
2
|
+
language: ruby
|
3
|
+
cache: bundler
|
1
4
|
rvm:
|
2
|
-
- 1.8.7
|
3
|
-
- 1.9.2
|
4
5
|
- 1.9.3
|
5
|
-
-
|
6
|
-
|
7
|
-
-
|
8
|
-
-
|
6
|
+
- 2.0.0
|
7
|
+
- 2.1.10
|
8
|
+
- 2.2.10
|
9
|
+
- 2.3.8
|
10
|
+
- 2.4.5
|
11
|
+
- 2.5.3
|
12
|
+
- 2.6.0
|
13
|
+
- ruby-head
|
14
|
+
- jruby-9.2.5.0
|
15
|
+
before_install:
|
16
|
+
- gem install bundler -v 1.17.3
|
17
|
+
git:
|
18
|
+
submodules: false
|
19
|
+
gemfile:
|
20
|
+
- Gemfile
|
9
21
|
matrix:
|
10
|
-
|
11
|
-
- rvm:
|
12
|
-
|
13
|
-
- rvm:
|
14
|
-
|
15
|
-
- rvm:
|
16
|
-
|
17
|
-
|
18
|
-
|
22
|
+
include:
|
23
|
+
- rvm: 2.5.3
|
24
|
+
gemfile: gemfiles/rubyracer
|
25
|
+
- rvm: jruby-9.2.5.0
|
26
|
+
gemfile: gemfiles/rubyrhino
|
27
|
+
- rvm: 2.5.3
|
28
|
+
gemfile: gemfiles/alaska
|
29
|
+
env: ALASKA=1
|
30
|
+
allow_failures:
|
31
|
+
- rvm: 2.5.3
|
32
|
+
gemfile: gemfiles/alaska
|
33
|
+
env: ALASKA=1
|
34
|
+
- rvm: ruby-head
|
35
|
+
fast_finish: true
|
data/.yardopts
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,327 @@
|
|
1
|
+
## 4.2.0 (25 September 2019)
|
2
|
+
|
3
|
+
- show code context for error messages (#167)
|
4
|
+
- defer initialisation of ExecJS context to fix #165
|
5
|
+
|
6
|
+
## 4.1.20 (17 November 2018)
|
7
|
+
|
8
|
+
- update UglifyJS to [3.4.8](https://github.com/mishoo/UglifyJS2/compare/v3.4.9...v3.4.8)
|
9
|
+
|
10
|
+
## 4.1.19 (11 September 2018)
|
11
|
+
|
12
|
+
- update UglifyJS to [3.4.9](https://github.com/mishoo/UglifyJS2/compare/v3.4.7...v3.4.9)
|
13
|
+
|
14
|
+
## 4.1.18 (09 August 2018)
|
15
|
+
|
16
|
+
- update UglifyJS to [3.4.7](https://github.com/mishoo/UglifyJS2/compare/v3.4.6...v3.4.7)
|
17
|
+
|
18
|
+
## 4.1.17 (29 July 2018)
|
19
|
+
|
20
|
+
- update UglifyJS to [3.4.6](https://github.com/mishoo/UglifyJS2/compare/v3.4.5...v3.4.6)
|
21
|
+
|
22
|
+
## 4.1.16 (22 July 2018)
|
23
|
+
|
24
|
+
- update UglifyJS to [3.4.5](https://github.com/mishoo/UglifyJS2/compare/v3.4.4...v3.4.5)
|
25
|
+
|
26
|
+
## 4.1.15 (13 July 2018)
|
27
|
+
|
28
|
+
- update UglifyJS to [3.4.4](https://github.com/mishoo/UglifyJS2/compare/v3.4.3...v3.4.4)
|
29
|
+
|
30
|
+
## 4.1.14 (02 July 2018)
|
31
|
+
|
32
|
+
- update UglifyJS to [3.4.3](https://github.com/mishoo/UglifyJS2/compare/v3.4.2...v3.4.3)
|
33
|
+
|
34
|
+
## 4.1.13 (30 June 2018)
|
35
|
+
|
36
|
+
- update UglifyJS to [3.4.2](https://github.com/mishoo/UglifyJS2/compare/v3.4.1...v3.4.2)
|
37
|
+
|
38
|
+
## 4.1.12 (20 June 2018)
|
39
|
+
|
40
|
+
- update UglifyJS to [3.4.1](https://github.com/mishoo/UglifyJS2/compare/v3.4.0...v3.4.1)
|
41
|
+
|
42
|
+
## 4.1.11 (02 June 2018)
|
43
|
+
|
44
|
+
- update UglifyJS to [3.3.28](https://github.com/mishoo/UglifyJS2/compare/v3.3.22...v3.3.28)
|
45
|
+
|
46
|
+
## 4.1.10 (21 April 2018)
|
47
|
+
|
48
|
+
- update UglifyJS to [3.3.22](https://github.com/mishoo/UglifyJS2/compare/v3.3.20...v3.3.22)
|
49
|
+
|
50
|
+
## 4.1.9 (11 April 2018)
|
51
|
+
|
52
|
+
- update UglifyJS to [3.3.20](https://github.com/mishoo/UglifyJS2/compare/v3.3.16...v3.3.20)
|
53
|
+
|
54
|
+
## 4.1.8 (14 March 2018)
|
55
|
+
|
56
|
+
- update UglifyJS to [3.3.15](https://github.com/mishoo/UglifyJS2/compare/v3.3.14...v3.3.15)
|
57
|
+
|
58
|
+
## 4.1.7 (11 March 2018)
|
59
|
+
|
60
|
+
- update UglifyJS to [3.3.14](https://github.com/mishoo/UglifyJS2/compare/v3.3.10...v3.3.14)
|
61
|
+
|
62
|
+
## 4.1.6 (08 February 2018)
|
63
|
+
|
64
|
+
- update UglifyJS to [3.3.10](https://github.com/mishoo/UglifyJS2/compare/v3.3.9...v3.3.10)
|
65
|
+
- update uglify-es to [3.3.10](https://github.com/mishoo/UglifyJS2/compare/harmony-v3.3.9...harmony-v3.3.10)
|
66
|
+
|
67
|
+
## 4.1.5 (28 January 2018)
|
68
|
+
|
69
|
+
- update UglifyJS to [3.3.9](https://github.com/mishoo/UglifyJS2/compare/v3.3.8...v3.3.9)
|
70
|
+
- update uglify-es to [3.3.9](https://github.com/mishoo/UglifyJS2/compare/harmony-v3.3.8...harmony-v3.3.9)
|
71
|
+
|
72
|
+
## 4.1.4 (22 January 2018)
|
73
|
+
|
74
|
+
- update UglifyJS to [3.3.8](https://github.com/mishoo/UglifyJS2/compare/v3.3.5...v3.3.8)
|
75
|
+
- update uglify-es to [3.3.8](https://github.com/mishoo/UglifyJS2/compare/harmony-v3.3.5...harmony-v3.3.8)
|
76
|
+
|
77
|
+
## 4.1.3 (7 January 2018)
|
78
|
+
|
79
|
+
- update UglifyJS to 3.3.5
|
80
|
+
|
81
|
+
## 4.1.2 (30 December 2017)
|
82
|
+
|
83
|
+
- update UglifyJS to 3.3.4
|
84
|
+
|
85
|
+
## 4.1.1 (29 December 2017)
|
86
|
+
|
87
|
+
- update UglifyJS to 3.3.3
|
88
|
+
|
89
|
+
## 4.1.0 (28 December 2017)
|
90
|
+
|
91
|
+
- update UglifyJS to 3.3.2
|
92
|
+
- `cascade` compress option is merged into `collapse_vars`
|
93
|
+
|
94
|
+
## 4.0.2 (10 December 2017)
|
95
|
+
|
96
|
+
- update UglifyJS to 3.2.2
|
97
|
+
- show harmony suggestion when using for-of loops
|
98
|
+
|
99
|
+
## 4.0.1 (3 December 2017)
|
100
|
+
|
101
|
+
- update UglifyJS to 3.2.1
|
102
|
+
|
103
|
+
## 4.0.0 (2 December 2017)
|
104
|
+
|
105
|
+
- update UglifyJS to 3.2.0
|
106
|
+
- remove Angular ngInject processing
|
107
|
+
- add unsafe_math compress option
|
108
|
+
- add reduce_funcs compress option
|
109
|
+
- add parse options
|
110
|
+
- add shebang output option
|
111
|
+
- add keep_infinity compress option
|
112
|
+
- add quote_style output option
|
113
|
+
- add side_effects compress option
|
114
|
+
- add switches compress option
|
115
|
+
- more helpful error Message in Harmony mode
|
116
|
+
|
117
|
+
Dropped options:
|
118
|
+
|
119
|
+
- output: angular
|
120
|
+
- mangle: except => reserved
|
121
|
+
- mangle_properties: ignore_quoted => keep_quoted
|
122
|
+
- enclose
|
123
|
+
- squeeze, copyright and screw_ie8 options
|
124
|
+
|
125
|
+
|
126
|
+
## 3.2.0 (9 April 2017)
|
127
|
+
|
128
|
+
- experimental ES6/Harmony mode based on UglifyJS2 Harmony branch
|
129
|
+
- update UglifyJS to 2.8.22
|
130
|
+
|
131
|
+
## 3.1.13 (3 April 2017)
|
132
|
+
|
133
|
+
- update UglifyJS to 2.8.21
|
134
|
+
|
135
|
+
## 3.1.12 (31 March 2017)
|
136
|
+
|
137
|
+
- update UglifyJS to 2.8.20
|
138
|
+
|
139
|
+
## 3.1.11 (28 March 2017)
|
140
|
+
|
141
|
+
- update UglifyJS to 2.8.17
|
142
|
+
|
143
|
+
## 3.1.10 (25 March 2017)
|
144
|
+
|
145
|
+
- update UglifyJS to 2.8.16
|
146
|
+
|
147
|
+
## 3.1.9 (19 March 2017)
|
148
|
+
|
149
|
+
- update UglifyJS to 2.8.14
|
150
|
+
|
151
|
+
## 3.1.8 (17 March 2017)
|
152
|
+
|
153
|
+
- update UglifyJS to 2.8.13
|
154
|
+
|
155
|
+
## 3.1.7 (11 March 2017)
|
156
|
+
|
157
|
+
- fix NoMethodError on `Uglifier.compile(source, source_map: false)` (#114)
|
158
|
+
- update UglifyJS to 2.8.12
|
159
|
+
|
160
|
+
## 3.1.6 (9 March 2017)
|
161
|
+
|
162
|
+
- update UglifyJS to 2.8.11
|
163
|
+
|
164
|
+
## 3.1.5 (8 March 2017)
|
165
|
+
|
166
|
+
- update UglifyJS to 2.8.9
|
167
|
+
|
168
|
+
## 3.1.4 (5 March 2017)
|
169
|
+
|
170
|
+
- Update UglifyJS to 2.8.7
|
171
|
+
|
172
|
+
## 3.1.3 (2 March 2017)
|
173
|
+
|
174
|
+
- update UglifyJS to 2.8.5
|
175
|
+
- default passes to 1
|
176
|
+
- allow source_map option to be `true` instead of a hash
|
177
|
+
|
178
|
+
## 3.1.2 (1 March 2017)
|
179
|
+
|
180
|
+
- fix `reduce_vars` compressor option
|
181
|
+
- add `passes` compressor option
|
182
|
+
- update UglifyJS to 2.8.4
|
183
|
+
|
184
|
+
## 3.1.1 (27 February 2017)
|
185
|
+
|
186
|
+
- disable `reduce_vars` by default as it causes JS errors (#110)
|
187
|
+
|
188
|
+
## 3.1.0 (27 February 2017)
|
189
|
+
|
190
|
+
- update UglifyJS to 2.8.0
|
191
|
+
- add reduce_vars compress option
|
192
|
+
- enable `reduce_vars` and `collapse_vars` compress options by default
|
193
|
+
- unused top-level function and variable removal with `toplevel` compress option
|
194
|
+
- add `top_retain` compress option to specify list of top-level variables to always retain
|
195
|
+
- add `unsafe_comps` and `unsafe_proto` options
|
196
|
+
|
197
|
+
## 3.0.4 (30 November 2016)
|
198
|
+
|
199
|
+
- update UglifyJS to 2.7.5
|
200
|
+
- implement ignore_quoted and debug options for mangle_properties
|
201
|
+
|
202
|
+
## 3.0.3 (24 October 2016)
|
203
|
+
|
204
|
+
- update UglifyJS to 2.7.4
|
205
|
+
- add wrap_iife output option to wrap IIFEs in parenthesis
|
206
|
+
|
207
|
+
## 3.0.2 (20 August 2016)
|
208
|
+
|
209
|
+
- add top-level keep_fnames option that implies both compressor and mangler keep_fnames
|
210
|
+
- update UglifyJS to 2.7.3
|
211
|
+
|
212
|
+
## 3.0.1 (28 July 2016)
|
213
|
+
|
214
|
+
- update UglifyJS to 2.7.0
|
215
|
+
- split JS dependencies to separate files
|
216
|
+
|
217
|
+
## 3.0.0 (22 March 2016)
|
218
|
+
|
219
|
+
- drop support for Ruby 1.8
|
220
|
+
- remove json as dependency
|
221
|
+
- discard unused function arguments only in unsafe mode
|
222
|
+
- add `keep_fnames` option to preserve function names in compressed code
|
223
|
+
- add `collapse_vars` option to collapse single-use variables
|
224
|
+
- backwards incompatible changes to source map options
|
225
|
+
- support for inline base64 encoded source maps
|
226
|
+
- mangle property names option (disabled by default)
|
227
|
+
- update UglifyJS to 2.6.2
|
228
|
+
|
229
|
+
## 2.7.2 (26 August 2015)
|
230
|
+
|
231
|
+
- update UglifyJS to 2.4.24
|
232
|
+
|
233
|
+
## 2.7.1 (27 February 2015)
|
234
|
+
|
235
|
+
- fix compatibility with experimental Alaska ExecJS runtime
|
236
|
+
|
237
|
+
## 2.7.0 (8 January 2015)
|
238
|
+
|
239
|
+
- copyright comment preservation also includes comments starting with a bang (!)
|
240
|
+
|
241
|
+
## 2.6.1 (1 January 2015)
|
242
|
+
|
243
|
+
- update UglifyJS to 2.4.16
|
244
|
+
|
245
|
+
## 2.6.0 (8 December 2014)
|
246
|
+
|
247
|
+
- allow metadata to be appended to minified code
|
248
|
+
|
249
|
+
## 2.5.3 (18 July 2014)
|
250
|
+
|
251
|
+
- no changes
|
252
|
+
|
253
|
+
## 2.5.2 (18 July 2014)
|
254
|
+
|
255
|
+
- update UglifyJS to 2.4.15
|
256
|
+
|
257
|
+
## 2.5.1 (13 June 2014)
|
258
|
+
|
259
|
+
- update UglifyJS to 2.4.14
|
260
|
+
|
261
|
+
## 2.5.0 (15 March 2014)
|
262
|
+
|
263
|
+
- update UglifyJS to 2.4.13
|
264
|
+
- process Angular @ngInject annotations
|
265
|
+
- add keep_fargs option
|
266
|
+
- change `ascii_only` default to true
|
267
|
+
|
268
|
+
## 2.4.0 (19 December 2013)
|
269
|
+
|
270
|
+
- update UglifyJS to 2.4.8
|
271
|
+
- add drop_console compress option
|
272
|
+
|
273
|
+
## 2.3.3 (12 December 2013)
|
274
|
+
|
275
|
+
- update UglifyJS to 2.4.7
|
276
|
+
|
277
|
+
## 2.3.2 (1 December 2013)
|
278
|
+
|
279
|
+
- update UglifyJS to 2.4.6
|
280
|
+
- document missing mangler and output options
|
281
|
+
|
282
|
+
## 2.3.1 (8 November 2013)
|
283
|
+
|
284
|
+
- update UglifyJS to 2.4.3
|
285
|
+
|
286
|
+
## 2.3.0 (26 October 2013)
|
287
|
+
|
288
|
+
- use JSON gem instead of multi_json
|
289
|
+
- update UglifyJS to 2.4.1
|
290
|
+
- fix issues with some Unicode JS identifiers (#47, #58)
|
291
|
+
|
292
|
+
## 2.2.1 (28 August 2013)
|
293
|
+
|
294
|
+
- fix IE8 compatibility
|
295
|
+
|
296
|
+
## 2.2.0 (25 August 2013)
|
297
|
+
|
298
|
+
- update UglifyJS to 2.4.0
|
299
|
+
- add `negate_iife` compressor option
|
300
|
+
- escape null characters as \x00, so that null followed by number isn't
|
301
|
+
interpreted as octal (#47)
|
302
|
+
|
303
|
+
## 2.1.2 (7 July 2013)
|
304
|
+
|
305
|
+
- update UglifyJS to 2.3.6
|
306
|
+
|
307
|
+
## 2.1.1 (18 May 2013)
|
308
|
+
|
309
|
+
- fix JScript compatibility
|
310
|
+
- update UglifyJS to 2.3.4
|
311
|
+
|
312
|
+
## 2.1.0 (8 May 2013)
|
313
|
+
|
314
|
+
- update to UglifyJS 2.3.0
|
315
|
+
- add enclose and screw_ie8 options
|
316
|
+
|
317
|
+
## 2.0.1 (6 April 2013)
|
318
|
+
|
319
|
+
- fix compatibility with Sprockets 2.9.0
|
320
|
+
|
321
|
+
## 2.0.0 (6 April 2013)
|
322
|
+
|
323
|
+
This release is backwards incompatible for JS compressor options.
|
324
|
+
|
325
|
+
- update UglifyJS to 2.2.5
|
326
|
+
- change compressor arguments to align with UglifyJS2
|
327
|
+
- `compile_with_map`: generate source maps for minified code
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# Contributing to Uglifier
|
2
|
+
|
3
|
+
Any contributions to Uglifier are welcome, whether they are feedback, bug reports, or - even better - pull requests.
|
4
|
+
|
5
|
+
## Development
|
6
|
+
|
7
|
+
To start working on Uglifier, fork the repo to your own account. [Ruby](https://www.ruby-lang.org), [bundler](http://bundler.io) and [Node.js](http://nodejs.org) are required as dependencies.
|
8
|
+
|
9
|
+
Ensure that your local copy is up-to-date before you start working on a feature or a bug fix. You should write any new code in a topic branch.
|
10
|
+
|
11
|
+
### Tests
|
12
|
+
|
13
|
+
Try to write a test case that reproduces the problem you're trying to fix or describes a feature that you want to build. Tests are located in `spec/` directory.
|
14
|
+
|
15
|
+
Tests as a pull request are appreciated even without a fix to highlight or reproduce a problem.
|
16
|
+
|
17
|
+
To run tests, first install all project dependencies:
|
18
|
+
|
19
|
+
bundle install
|
20
|
+
|
21
|
+
Then run tests using rake:
|
22
|
+
|
23
|
+
bundle exec rake
|
24
|
+
|
25
|
+
### Updating UglifyJS and source-map
|
26
|
+
|
27
|
+
[UglifyJS](https://github.com/mishoo/UglifyJS2) and [source-map](https://github.com/mozilla/source-map/) are included in the project as Git submodules. To install submodules, run in your terminal
|
28
|
+
|
29
|
+
git submodule update --init
|
30
|
+
|
31
|
+
After that, UglifyJS can be updated to a specific version with rake task.
|
32
|
+
|
33
|
+
rake uglifyjs:update VERSION=3.3.4
|
34
|
+
|
35
|
+
To compile JS with dependencies, run
|
36
|
+
|
37
|
+
rake uglifyjs:build
|
38
|
+
|
39
|
+
You can even write custom patches to UglifyJS in `vendor/uglifyjs` and `vendor/uglifyjs-harmony` directories and compile the bundles JS using the command above. However, for the changes to be releasable, they should be in UglifyJS repository.
|
40
|
+
|
41
|
+
To automatically update UglifyJS version and commit changes
|
42
|
+
|
43
|
+
rake uglifyjs VERSION=3.3.4
|
44
|
+
|
45
|
+
## Reporting issues
|
46
|
+
|
47
|
+
Uglifier uses the [GitHub issue tracker](https://github.com/lautis/uglifier/issues) to track bugs and features. Before submitting a bug report or feature request, check to make sure it hasn't already been submitted. When submitting a bug report, please include a Gist that includes a stack trace and any details that may be necessary to reproduce the bug, including your gem version, Ruby version, and **ExecJS runtime**. Ideally, a bug report should include a pull request with failing specs.
|
data/Gemfile
CHANGED
@@ -1,25 +1,5 @@
|
|
1
|
-
source "
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
gem "multi_json", "~> 1.0", ">= 1.0.2"
|
3
|
+
gemspec
|
5
4
|
|
6
|
-
|
7
|
-
execjs_runtimes = {
|
8
|
-
"RubyRacer" => "therubyracer",
|
9
|
-
"RubyRhino" => "therubyrhino",
|
10
|
-
"Mustang" => "mustang"
|
11
|
-
}
|
12
|
-
|
13
|
-
if ENV["EXECJS_RUNTIME"] && execjs_runtimes[ENV["EXECJS_RUNTIME"]]
|
14
|
-
gem execjs_runtimes[ENV["EXECJS_RUNTIME"]], :group => :development
|
15
|
-
end
|
16
|
-
|
17
|
-
# Engine
|
18
|
-
gem ENV["MULTI_JSON_ENGINE"], :group => :development if ENV["MULTI_JSON_ENGINE"]
|
19
|
-
|
20
|
-
group :development do
|
21
|
-
gem "rspec", "~> 2.7"
|
22
|
-
gem "bundler", "~> 1.0"
|
23
|
-
gem "jeweler", "~> 1.8.3"
|
24
|
-
gem "rdoc", "~> 3.11"
|
25
|
-
end
|
5
|
+
gem 'rubocop', '~> 0.57.0', :group => [:development] if RUBY_VERSION >= '2.1'
|