2013-03-11 19:14:26 +00:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
|
|
|
|
// Project configuration.
|
|
|
|
grunt.initConfig({
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
|
|
|
|
|
|
clean: ['dist/'],
|
|
|
|
|
|
|
|
uglify: {
|
|
|
|
options: {
|
|
|
|
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
|
|
|
|
},
|
|
|
|
develop: {
|
2014-01-14 15:56:36 +00:00
|
|
|
src: 'dist/filer.js',
|
|
|
|
dest: 'dist/filer.min.js'
|
2013-03-11 19:14:26 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2013-11-08 20:33:44 +00:00
|
|
|
jshint: {
|
|
|
|
// Don't bother with src/path.js
|
2013-11-22 21:12:31 +00:00
|
|
|
all: ['gruntfile.js',
|
|
|
|
'src/constants.js',
|
|
|
|
'src/error.js',
|
|
|
|
'src/fs.js',
|
|
|
|
'src/shared.js',
|
2013-12-01 21:41:04 +00:00
|
|
|
'src/providers/**/*.js',
|
|
|
|
'src/adapters/**/*.js'
|
2013-11-22 21:12:31 +00:00
|
|
|
]
|
2013-11-08 20:33:44 +00:00
|
|
|
},
|
|
|
|
|
2013-03-11 19:14:26 +00:00
|
|
|
requirejs: {
|
|
|
|
develop: {
|
|
|
|
options: {
|
|
|
|
paths: {
|
|
|
|
"src": "../src",
|
|
|
|
"build": "../build"
|
|
|
|
},
|
|
|
|
baseUrl: "lib",
|
|
|
|
name: "build/almond",
|
2013-12-15 03:36:24 +00:00
|
|
|
include: ["src/index"],
|
2014-01-14 15:56:36 +00:00
|
|
|
out: "dist/filer.js",
|
2013-03-11 19:14:26 +00:00
|
|
|
optimize: "none",
|
|
|
|
wrap: {
|
|
|
|
startFile: 'build/wrap.start',
|
|
|
|
endFile: 'build/wrap.end'
|
2013-11-27 18:08:26 +00:00
|
|
|
},
|
|
|
|
shim: {
|
2013-12-02 20:10:43 +00:00
|
|
|
// TextEncoder and TextDecoder shims. encoding-indexes must get loaded first,
|
|
|
|
// and we use a fake one for reduced size, since we only care about utf8.
|
2013-11-27 18:08:26 +00:00
|
|
|
"encoding": {
|
2013-12-02 20:10:43 +00:00
|
|
|
deps: ["encoding-indexes-shim"]
|
2013-11-27 18:08:26 +00:00
|
|
|
}
|
2013-03-11 19:14:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-11-27 18:08:26 +00:00
|
|
|
}
|
2013-03-11 19:14:26 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-requirejs');
|
2013-11-08 20:33:44 +00:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
2013-03-11 19:14:26 +00:00
|
|
|
|
|
|
|
grunt.registerTask('develop', ['clean', 'requirejs']);
|
|
|
|
grunt.registerTask('release', ['develop', 'uglify']);
|
2013-11-08 20:33:44 +00:00
|
|
|
grunt.registerTask('check', ['jshint']);
|
2013-03-11 19:14:26 +00:00
|
|
|
|
|
|
|
grunt.registerTask('default', ['develop']);
|
2013-11-22 21:12:31 +00:00
|
|
|
};
|