filer/gruntfile.js

103 lines
2.5 KiB
JavaScript
Raw Normal View History

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: {
src: 'dist/filer.js',
dest: 'dist/filer.min.js'
}
},
jshint: {
// Don't bother with src/path.js
all: [
'gruntfile.js',
'src/constants.js',
'src/errors.js',
'src/fs.js',
'src/index.js',
'src/shared.js',
'src/shell.js',
2014-03-08 01:21:10 +00:00
'src/fswatcher.js',
'src/environment.js',
'src/providers/**/*.js',
2014-03-18 16:29:20 +00:00
'src/adapters/**/*.js',
'src/directory-entry.js',
'src/open-file-description.js',
'src/super-node.js',
'src/node.js',
2014-03-18 18:16:12 +00:00
'src/stats.js',
'src/filesystem/**/*.js'
]
},
connect: {
server: {
options: {
port: 9001,
hostname: '127.0.0.1',
base: '.'
}
}
},
mocha: {
test: {
options: {
log: true,
urls: [ 'http://127.0.0.1:9001/tests/index.html' ]
}
}
},
requirejs: {
develop: {
options: {
paths: {
"src": "../src",
"build": "../build"
},
baseUrl: "lib",
name: "build/almond",
2013-12-15 03:36:24 +00:00
include: ["src/index"],
out: "dist/filer.js",
optimize: "none",
wrap: {
startFile: 'build/wrap.start',
endFile: 'build/wrap.end'
},
shim: {
// 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.
"encoding": {
deps: ["encoding-indexes-shim"]
}
}
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('develop', ['clean', 'requirejs']);
grunt.registerTask('release', ['develop', 'uglify']);
grunt.registerTask('check', ['jshint']);
grunt.registerTask('test', ['check', 'connect', 'mocha']);
grunt.registerTask('default', ['develop']);
};