forked from alex-seville/feta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
80 lines (76 loc) · 2.51 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
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
71
72
73
74
75
76
77
78
79
80
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
uglify: {
options: {
},
build: {
src: 'lib/feta.js',
dest: 'tmp/feta.min.js'
}
},
stringify: {
feta:{
options: {
header: "var fetaStr=\"if (!window.feta){",
footer: "}\";\n//@ sourceURL=feta.js"
},
files:{
"tmp/feta.min.str.js": "tmp/feta.min.js"
}
}
},
concat:{
new_devtools: {
options: {
separator: '\n',
banner: '<%= fetaSourceHeader %>\n',
footer: '\n<%= fetaSourceFooter %>'
},
files: {
'dist/devtoolsjs/fetaSource.js': ['extension/devtoolsjs/fetaSource.js', 'tmp/feta.min.str.js']
}
}
},
fetaSourceHeader: "(function(root){",
fetaSourceFooter: "})(window);",
copy: {
main: {
files: [
{src: ['extension/background.js'], dest: 'dist/background.js', filter: 'isFile'},
{src: ['extension/devtools.js'], dest: 'dist/devtools.js', filter: 'isFile'},
{src: ['extension/devtools.html'], dest: 'dist/devtools.html', filter: 'isFile'},
{src: ['extension/manifest.json'], dest: 'dist/manifest.json', filter: 'isFile'},
{src: ['extension/Panel.html'], dest: 'dist/Panel.html', filter: 'isFile'},
{src: ['extension/panel.js'], dest: 'dist/panel.js', filter: 'isFile'},
{src: ['components/jquery/jquery.js'], dest: 'dist/js/jquery.js', filter: 'isFile'},
{expand: true,cwd: 'extension/css/', src: ['*'], dest: 'dist/css/'},
{expand: true,cwd: 'extension/js/', src: ['*.js'], dest: 'dist/js/'},
{expand: true,cwd: 'extension/devtoolsjs/', src: ['*.js'], dest: 'dist/devtoolsjs/'},
{expand: true,cwd: 'extension/images/', src: ['*.png'], dest: 'dist/images/'}
]
}
},
watch: {
scripts: {
files: ['extension/**/*','lib/*'],
tasks: ['default'],
options: {
nospawn: true
}
}
},
qunit: {
all: ['test/**/*.html']
}
});
grunt.loadTasks('tasks');
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-qunit');
// Default task(s).
grunt.registerTask('default', ['qunit','uglify','stringify','copy','concat','watch']);
};