Skip to content

Commit 7650beb

Browse files
committed
Fixes requirejs#67, uglifyjs options were not being passed correctly.
1 parent 1d5f969 commit 7650beb

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

build/example.build.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@
6868
//used to pass configuration values to UglifyJS.
6969
//See https://github.com/mishoo/UglifyJS for the possible values.
7070
uglify: {
71-
gen_codeOptions: {},
72-
strict_semicolons: {},
73-
do_toplevel: {},
74-
ast_squeezeOptions: {}
71+
toplevel: true,
72+
ascii_only: true,
73+
beautify: true
7574
},
7675

7776
//If using Closure Compiler for script optimization, these config options
@@ -81,7 +80,7 @@
8180
CompilerOptions: {},
8281
CompilationLevel: 'SIMPLE_OPTIMIZATIONS',
8382
loggingLevel: 'WARNING'
84-
}
83+
},
8584

8685
//Allow CSS optimizations. Allowed values:
8786
//- "standard": @import inlining, comment removal and line returns.

build/jslib/optimize.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,19 +254,18 @@ function (lang, logger, envOptimize, file, parse,
254254
uglify: function (fileName, fileContents, keepLines, config) {
255255
var parser = uglify.parser,
256256
processor = uglify.uglify,
257-
ast, genCodeConfig;
257+
ast;
258258

259259
config = config || {};
260-
genCodeConfig = config.gen_codeOptions || keepLines;
261260

262261
logger.trace("Uglifying file: " + fileName);
263262

264263
try {
265-
ast = parser.parse(fileContents, config.strict_semicolons);
266-
ast = processor.ast_mangle(ast, config.do_toplevel);
267-
ast = processor.ast_squeeze(ast, config.ast_squeezeOptions);
264+
ast = parser.parse(fileContents, config);
265+
ast = processor.ast_mangle(ast, config);
266+
ast = processor.ast_squeeze(ast, config);
268267

269-
fileContents = processor.gen_code(ast, genCodeConfig);
268+
fileContents = processor.gen_code(ast, config);
270269
} catch (e) {
271270
logger.error('Cannot uglify file: ' + fileName + '. Skipping it. Error is:\n' + e.toString());
272271
}

dist/r-edge.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license r.js 1.0.2+ 20111222 3:30pm Pacific Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
2+
* @license r.js 1.0.2+ 20111222 3:45pm Pacific Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
33
* Available via the MIT or new BSD license.
44
* see: http://github.com/jrburke/requirejs for details
55
*/
@@ -20,7 +20,7 @@ var requirejs, require, define;
2020

2121
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
2222
nodeDefine, exists, reqMain, loadedOptimizedLib,
23-
version = '1.0.2+ 20111222 3:30pm Pacific',
23+
version = '1.0.2+ 20111222 3:45pm Pacific',
2424
jsSuffixRegExp = /\.js$/,
2525
commandOption = '',
2626
//Used by jslib/rhino/args.js
@@ -7630,19 +7630,18 @@ function (lang, logger, envOptimize, file, parse,
76307630
uglify: function (fileName, fileContents, keepLines, config) {
76317631
var parser = uglify.parser,
76327632
processor = uglify.uglify,
7633-
ast, genCodeConfig;
7633+
ast;
76347634

76357635
config = config || {};
7636-
genCodeConfig = config.gen_codeOptions || keepLines;
76377636

76387637
logger.trace("Uglifying file: " + fileName);
76397638

76407639
try {
7641-
ast = parser.parse(fileContents, config.strict_semicolons);
7642-
ast = processor.ast_mangle(ast, config.do_toplevel);
7643-
ast = processor.ast_squeeze(ast, config.ast_squeezeOptions);
7640+
ast = parser.parse(fileContents, config);
7641+
ast = processor.ast_mangle(ast, config);
7642+
ast = processor.ast_squeeze(ast, config);
76447643

7645-
fileContents = processor.gen_code(ast, genCodeConfig);
7644+
fileContents = processor.gen_code(ast, config);
76467645
} catch (e) {
76477646
logger.error('Cannot uglify file: ' + fileName + '. Skipping it. Error is:\n' + e.toString());
76487647
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy