File tree 5 files changed +39
-4
lines changed
5 files changed +39
-4
lines changed Original file line number Diff line number Diff line change 1
1
node_modules
2
2
.DS_Store
3
+ dist
Original file line number Diff line number Diff line change 1
1
module . exports = function ( grunt ) {
2
2
grunt . initConfig ( {
3
+ pkg : grunt . file . readJSON ( 'package.json' ) ,
4
+
3
5
qunit : {
4
6
files : [ 'test/index.html' ]
7
+ } ,
8
+
9
+ uglify : {
10
+ options : {
11
+ banner : '/*!\n' +
12
+ '* <%= pkg.name %> JavaScript Library v<%= pkg.version %>\n' +
13
+ '* <%= pkg.homepage %>\n' +
14
+ '*\n' +
15
+ '*\n' +
16
+ '* Released under the <%= pkg.license.type %> license\n' +
17
+ '* <%= pkg.license.url %>\n' +
18
+ '*\n' +
19
+ '* Date: <%= grunt.template.today("yyyy-mm-dd") %>\n' +
20
+ '*\n' +
21
+ '*/\n'
22
+ } ,
23
+ dist : {
24
+ files : { 'dist/<%= pkg.name %>.min.js' : [ '<%= pkg.name %>.js' ] }
25
+ }
5
26
}
6
27
} ) ;
7
28
8
29
grunt . loadNpmTasks ( "grunt-contrib-qunit" ) ;
30
+ grunt . loadNpmTasks ( "grunt-contrib-uglify" ) ;
9
31
grunt . registerTask ( 'test' , 'qunit' ) ;
10
32
grunt . registerTask ( 'default' , [ 'qunit' ] ) ;
33
+ grunt . registerTask ( 'build' , [ 'qunit' , 'uglify' ] ) ;
11
34
} ;
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ var VerEx = require("verbal-expressions");
39
39
(or)
40
40
$ grunt test
41
41
42
+ ## Creating a minified version
43
+
44
+ This will generate a minified version of VerbalExpressions.js (aptly named VerbalExpressions.min.js) in a _ dist_ folder.
45
+
46
+ $ grunt build
47
+
42
48
## Examples
43
49
44
50
Here's a couple of simple examples to give an idea of how VerbalExpressions works:
Original file line number Diff line number Diff line change 4
4
*
5
5
*
6
6
* Released under the MIT license
7
- * http://jquery .org/license
7
+ * http://opensource .org/licenses/MIT
8
8
*
9
9
* Date: 2013-07-19
10
10
*
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " verbal-expressions " ,
2
+ "name" : " VerbalExpressions " ,
3
3
"description" : " JavaScript Regular expressions made easy" ,
4
4
"version" : " 0.1.2" ,
5
5
"keywords" : [ " regular expressions" , " regex" ],
6
+ "homepage" : " https://github.com/VerbalExpressions/JSVerbalExpressions" ,
6
7
"devDependencies" : {
7
8
"grunt" : " ~0.4.2" ,
8
- "grunt-contrib-qunit" : " ~0.2.2"
9
+ "grunt-contrib-qunit" : " ~0.2.2" ,
10
+ "grunt-contrib-uglify" : " ~0.2.2"
9
11
},
10
12
"repository" : {
11
13
"type" : " git" ,
15
17
"url" : " https://github.com/VerbalExpressions/JSVerbalExpressions/issues"
16
18
},
17
19
"main" : " VerbalExpressions.js" ,
18
- "license" : " MIT" ,
20
+ "license" : {
21
+ "type" : " MIT" ,
22
+ "url" : " http://opensource.org/licenses/MIT"
23
+ },
19
24
"engines" : {
20
25
"node" : " >= 0.8.0"
21
26
}
You can’t perform that action at this time.
0 commit comments