Update to latest grunt
Change-Id: I69701a230426af9fa22d3cd312cb24bdc6cf5072
This commit is contained in:
32
Gruntfile.js
Normal file
32
Gruntfile.js
Normal file
@@ -0,0 +1,32 @@
|
||||
/*!
|
||||
* Grunt file
|
||||
*
|
||||
* @package jquery.i18n
|
||||
*/
|
||||
'use strict';
|
||||
/*jshint node:true */
|
||||
module.exports = function ( grunt ) {
|
||||
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
|
||||
grunt.loadNpmTasks( 'grunt-contrib-qunit' );
|
||||
|
||||
grunt.initConfig( {
|
||||
pkg: grunt.file.readJSON( 'package.json' ),
|
||||
jshint: {
|
||||
options: JSON.parse( grunt.file.read( '.jshintrc' )
|
||||
.replace( /\/\*(?:(?!\*\/)[\s\S])*\*\//g, '' ).replace( /\/\/[^\n\r]*/g, '' ) ),
|
||||
all: ['src/jquery.uls.core.js',
|
||||
'src/jquery.uls.lcd.js',
|
||||
'src/jquery.uls.data.utils.js',
|
||||
'src/jquery.uls.languagefilter.js',
|
||||
'src/jquery.uls.regionfilter.js' ]
|
||||
},
|
||||
qunit: {
|
||||
all: ['test/index.html']
|
||||
}
|
||||
} );
|
||||
|
||||
grunt.registerTask( 'lint', ['jshint'] );
|
||||
grunt.registerTask( 'unit', ['qunit'] );
|
||||
grunt.registerTask( 'test', ['lint', 'unit'] );
|
||||
grunt.registerTask( 'default', ['test'] );
|
||||
};
|
||||
99
grunt.js
99
grunt.js
@@ -1,99 +0,0 @@
|
||||
/* global module:false */
|
||||
module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('grunt-css');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
// Project configuration.
|
||||
grunt
|
||||
.initConfig({
|
||||
pkg : '<json:package.json>',
|
||||
meta : {
|
||||
banner : '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - '
|
||||
+ '<%= grunt.template.today("yyyy-mm-dd") %>\n'
|
||||
+ '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>'
|
||||
+ '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;'
|
||||
+ ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
|
||||
},
|
||||
concat : {
|
||||
js : {
|
||||
src: [ '<banner:meta.banner>','src/jquery.uls.data.js',
|
||||
'src/jquery.uls.data.utils.js', 'src/jquery.uls.lcd.js',
|
||||
'src/jquery.uls.languagefilter.js', 'src/jquery.uls.regionfilter.js',
|
||||
'src/jquery.uls.core.js'],
|
||||
dest : 'dist/<%= pkg.name %>/<%= pkg.name %>.js'
|
||||
},
|
||||
css: {
|
||||
src: [ 'css/jquery.uls.css', 'css/jquery.uls.grid.css',
|
||||
'css/jquery.uls.lcd.css', 'css/jquery.uls.compact.css' ],
|
||||
dest : 'dist/<%= pkg.name %>/css/<%= pkg.name %>.css'
|
||||
}
|
||||
},
|
||||
copy: {
|
||||
dist: {
|
||||
files: {
|
||||
'dist/jquery.uls/i18n/': 'i18n/**',
|
||||
'dist/jquery.uls/images/': 'images/**'
|
||||
}
|
||||
}
|
||||
},
|
||||
min : {
|
||||
dist : {
|
||||
src : [ '<banner:meta.banner>',
|
||||
'<config:concat.js.dest>' ],
|
||||
dest : 'dist/<%= pkg.name %>/<%= pkg.name %>.min.js'
|
||||
}
|
||||
},
|
||||
qunit : {
|
||||
files : [ 'test/**/*.html' ]
|
||||
},
|
||||
cssmin : {
|
||||
dist: {
|
||||
src : '<config:concat.css.dest>',
|
||||
dest : 'dist/<%= pkg.name %>/css/<%= pkg.name %>.min.css'
|
||||
}
|
||||
},
|
||||
lint : {
|
||||
files : [ 'src/**/*.js', 'test/**/*.js' ]
|
||||
},
|
||||
csslint : {
|
||||
file: [ 'css/**/*.css' ]
|
||||
},
|
||||
watch : {
|
||||
files : '<config:lint.files>',
|
||||
tasks : 'lint'
|
||||
},
|
||||
jshint : {
|
||||
options : {
|
||||
curly : true,
|
||||
eqeqeq : true,
|
||||
immed : true,
|
||||
latedef : true,
|
||||
newcap : true,
|
||||
noarg : true,
|
||||
sub : true,
|
||||
undef : true,
|
||||
boss : true,
|
||||
eqnull : true,
|
||||
browser : true,
|
||||
smarttabs : true,
|
||||
laxbreak : true,
|
||||
multistr: true
|
||||
},
|
||||
globals : {
|
||||
jQuery : true,
|
||||
QUnit : true,
|
||||
pluralRuleParser : true,
|
||||
_ : true,
|
||||
module : true,
|
||||
test : true
|
||||
}
|
||||
},
|
||||
uglify : {
|
||||
src : [ '<banner:meta.banner>', '<config:concat.dist.js>' ],
|
||||
dest : 'dist/<%= pkg.name %>.min.js'
|
||||
}
|
||||
});
|
||||
// Default task.
|
||||
grunt.registerTask('default', 'lint cssmin concat min copy csslint');
|
||||
grunt.registerTask('test', 'lint qunit');
|
||||
|
||||
};
|
||||
@@ -28,9 +28,11 @@
|
||||
"jQuery": "~1.7.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt": "~0.3.9",
|
||||
"grunt-compare-size": ">=0.1.4",
|
||||
"grunt-css": ">0.0.0",
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-cli": "~0.1",
|
||||
"grunt-contrib-jshint": "~0.5.4",
|
||||
"grunt-contrib-qunit": "~0.2.1",
|
||||
"grunt-contrib-jasmine": "~0.4",
|
||||
"grunt-contrib-copy": ">0.0.0"
|
||||
},
|
||||
"repository": {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<title>jQuery ULS Test Suite</title>
|
||||
|
||||
<!-- External libs -->
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" ></script>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" ></script>
|
||||
|
||||
<!-- Source of our libs -->
|
||||
<script src="../src/jquery.uls.data.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user