Debian Codegraph @

Gruntfile.js

raw symbols SCIP
1 "use strict";
2
3 module.exports = function(grunt) {
4
5 var pkg = grunt.file.readJSON("package.json");
6
7 // Project configuration.
8 grunt.initConfig({
9 // Metadata.
10 pkg: pkg,
11 banner: grunt.file.read("dev/copy.js").replace(/@VERSION/, pkg.version),
12 // Task configuration.
13 uglify: {
14 options: {
15 banner: "<%= banner %>"
16 },
17 dist: {
18 src: "<%= concat.dist.dest %>",
19 dest: "<%= pkg.name %>-min.js"
20 },
21 nodeps: {
22 src: "<%= concat.nodeps.dest %>",
23 dest: "<%= pkg.name %>-nodeps-min.js"
24 }
25 },
26 replace: {
27 dist: {
28 options: {
29 patterns: [{
30 match: "VERSION",
31 replacement: "<%= pkg.version %>"
32 }]
33 },
34 files: [{
35 expand: true,
36 flatten: true,
37 src: ["<%= concat.dist.dest %>", "<%= concat.nodeps.dest %>"],
38 dest: "./"
39 }]
40 }
41 },
42 concat: {
43 dist: {
44 dest: "<%= pkg.name %>.js",
45 src: [
46 "dev/eve.js",
47 "dev/raphael.core.js",
48 "dev/raphael.svg.js",
49 "dev/raphael.vml.js",
50 "dev/raphael.amd.js"
51 ]
52 },
53 nodeps: {
54 dest: "<%= pkg.name %>-nodeps.js",
55 src: [
56 "dev/raphael.core.js",
57 "dev/raphael.svg.js",
58 "dev/raphael.vml.js",
59 "dev/raphael.amd.js"
60 ]
61 }
62 }
63 });
64
65 // These plugins provide necessary tasks.
66 grunt.loadNpmTasks("grunt-contrib-concat");
67 grunt.loadNpmTasks("grunt-contrib-uglify");
68 grunt.loadNpmTasks("grunt-replace");
69
70 // Default task.
71 grunt.registerTask("default", ["concat", "replace", "uglify"]);
72 };