-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
70 lines (61 loc) · 2.05 KB
/
Copy pathGruntfile.js
File metadata and controls
70 lines (61 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
module.exports = function(grunt) {
var banner = '/*! <%= pkg.name %> <%= pkg.version %> | (c) <%= grunt.template.today("yyyy") %>, One World Schoolhouse, University of Toledo | The MIT License (MIT) */\n';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: ["dist/**/*.js"],
jshint: {
all: ['Gruntfile.js', 'src/**/*.js'],
},
uglify: {
options: {
banner: banner
},
build: {
src: 'dist/<%= pkg.name %>.js',
dest: 'dist/<%= pkg.name %>.min.js'
},
dist:{
src: 'dist/<%= pkg.name %>.standalone.js',
dest: 'dist/<%= pkg.name %>.standalone.min.js'
}
},
concat: {
options: {
stripBanners: false,
separator: ';\n',
},
build: {
src: [
'src/**/*.js'
],
dest: 'dist/<%= pkg.name %>.js',
},
dist: {
src: [
'node_modules/formulajs/node_modules/jStat/dist/jstat.min.js',
'node_modules/formulajs/node_modules/numeral/min/numeral.min.js',
'node_modules/formulajs/node_modules/numeric/numeric-*.min.js',
'node_modules/formulajs/node_modules/bessel/bessel.js',
'node_modules/formulajs/dist/formula.min.js',
'src/**/*.js'
],
dest: 'dist/<%= pkg.name %>.standalone.js',
},
},
watch: {
files: ['Gruntfile.js','src/**/*'],
tasks: ['clean', 'jshint','concat:build', 'uglify:build', 'concat:dist', 'uglify:dist'],
},
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task(s).
grunt.registerTask('default', ['clean', 'jshint','concat:build', 'uglify:build']);
grunt.registerTask('standalone', ['default', 'concat:dist', 'uglify:dist']);
grunt.registerTask('dev', ['default', 'standalone', 'watch']);
};