Remove useless CSS
[clamp.git] / src / main / resources / META-INF / resources / designer / modeler / Gruntfile.js
1 module.exports = function(grunt) {
2
3   require('load-grunt-tasks')(grunt);
4
5   var path = require('path');
6
7   /**
8    * Resolve external project resource as file path
9    */
10   function resolvePath(project, file) {
11     return path.join(path.dirname(require.resolve(project)), file);
12   }
13
14   // project configuration
15   grunt.initConfig({
16     pkg: grunt.file.readJSON('package.json'),
17
18     config: {
19       sources: 'app',
20       dist: 'dist'
21     },
22
23     jshint: {
24       src: [
25         ['<%=config.sources %>']
26       ],
27       options: {
28         jshintrc: true
29       }
30     },
31
32     browserify: {
33       options: {
34         browserifyOptions: {
35           // make sure we do not include browser shims unnecessarily
36           builtins: false,
37           insertGlobalVars: {
38             process: function () {
39                 return 'undefined';
40             },
41             Buffer: function () {
42                 return 'undefined';
43             }
44           }
45         },
46         transform: [ 'brfs' ]
47       },
48       watch: {
49         options: {
50           watch: true
51         },
52         files: {
53           '<%= config.dist %>/index.js': [ '<%= config.sources %>/**/*.js' ]
54         }
55       },
56       app: {
57         files: {
58           '<%= config.dist %>/index.js': [ '<%= config.sources %>/**/*.js' ]
59         }
60       }
61     },
62     copy: {
63       diagram_js: {
64         files: [
65           {
66             src: resolvePath('diagram-js', 'assets/diagram-js.css'),
67             dest: '<%= config.dist %>/css/diagram-js.css'
68           }
69         ]
70       },
71       app: {
72         files: [
73           {
74             expand: true,
75             cwd: '<%= config.sources %>/',
76             src: ['**/*.*', '!**/*.js'],
77             dest: '<%= config.dist %>'
78           }
79         ]
80       }
81     },
82     watch: {
83       samples: {
84         files: [ '<%= config.sources %>/**/*.*' ],
85         tasks: [ 'copy:app' ]
86       },
87     },
88     connect: {
89       options: {
90         port: 9013,
91         livereload: 9014,
92         hostname: 'localhost'
93       },
94       livereload: {
95         options: {
96           open: true,
97           base: [
98             '<%= config.dist %>'
99           ]
100         }
101       }
102     }
103   });
104
105   // tasks
106
107   grunt.registerTask('build', [ 'copy', 'browserify:app' ]);
108
109   grunt.registerTask('auto-build', [
110     'copy',
111     'browserify:watch',
112     'connect:livereload',
113     'watch'
114   ]);
115
116   grunt.registerTask('default', [ 'jshint', 'build' ]);
117 };