Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Be able to set charset configuration #18

Open
wants to merge 2 commits into from

2 participants

@sideroad

Could check and merge this modification?

Gruntfile.js
@@ -10,6 +10,16 @@ module.exports = function(grunt) {
'src': 'examples/example.js',
'dest': 'examples/example.min.js'
}]
+ },
+ 'charset': {
+ 'options': {
+ 'report': 'gzip',
+ 'charset': 'utf8'
@mathiasbynens Owner

Shouldn’t this be utf-8 (instead of utf8), as seen on http://yui.github.io/yuicompressor/?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@sideroad

Thanks for checking!
I've fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 31, 2013
  1. @sideroad
  2. @sideroad

    Fixed charset parameter

    sideroad authored
This page is out of date. Refresh to see the latest.
View
10 Gruntfile.js
@@ -10,6 +10,16 @@ module.exports = function(grunt) {
'src': 'examples/example.js',
'dest': 'examples/example.min.js'
}]
+ },
+ 'charset': {
+ 'options': {
+ 'report': 'gzip',
+ 'charset': 'utf-8'
+ },
+ 'files': [{
+ 'src': 'examples/example.utf8.js',
+ 'dest': 'examples/example.utf8.min.js'
+ }]
}
},
'cssmin': {
View
2  examples/example.min.js
@@ -1,4 +1,4 @@
/*! License comment */
(function(){
/*! Weird inline license comment */
-var foo=42,a="lol\x0bwat"}());
+;var foo=42,a="lol\x0bwat"}());
View
7 examples/example.utf8.js
@@ -0,0 +1,7 @@
+/*! License comment */
+(function() {
+ "";
+ /*! Weird inline license comment */
+ var foo = 42,
+ bar = '';
+}());
View
4 examples/example.utf8.min.js
@@ -0,0 +1,4 @@
+/*! License comment */
+(function(){
+/*! Weird inline license comment */
+;var b=42,a=""}());
View
1  tasks/lib/yui-compressor.js
@@ -27,6 +27,7 @@ exports.init = function(grunt) {
'type': 'yui-' + options.type,
'fileIn': source,
'fileOut': destination,
+ 'options': [ options.charset ? '--charset '+options.charset : '' ],
'callback': function(error) {
if (error) {
grunt.warn(error);
View
6 tasks/yui-compressor.js
@@ -20,7 +20,8 @@ module.exports = function(grunt) {
done();
}
},
- 'report': options.report
+ 'report': options.report,
+ 'charset': options.charset
});
});
});
@@ -43,7 +44,8 @@ module.exports = function(grunt) {
done();
}
},
- 'report': options.report
+ 'report': options.report,
+ 'charset': options.charset
});
});
});
Something went wrong with that request. Please try again.