/
Gruntfile.js
executable file
·42 lines (40 loc) · 1.11 KB
/
Gruntfile.js
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
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
buildFrontEnd: {
src: 'src/finlib.js',
dest: 'dist/finlib.min.js'
}
},
watch: {
scripts: {
files: ['src/**/*.js'],
tasks: ['file_append', 'uglify']
}
},
file_append: {
default_options: {
files: [
{
append: "module.exports = fin;",
input: 'src/finlib.js',
output: 'src/finlib.node.js'
}
]
}
},
'http-server': {
dev: {
root: '',
port: 3000,
host: "0.0.0.0"
}
}
});
grunt.loadNpmTasks('grunt-http-server');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-file-append');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['uglify', 'file_append', 'watch', 'http-server:dev']);
};