Skip to content

Commit e8d5de1

Browse files
committed
Add concat tasks
1 parent 69e8496 commit e8d5de1

File tree

2 files changed

+83
-11
lines changed

2 files changed

+83
-11
lines changed

Gruntfile.js

Lines changed: 77 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,85 @@ module.exports = function(grunt) {
88
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
99
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
1010
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
11-
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
12-
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
11+
'* Copyright (c) <%= grunt.template.today("yyyy") %> Nicole Sullivan and Nicholas C. Zakas;\n' +
12+
'* Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> <%= _.pluck(pkg.licenses, "url").join(", ") %> */\n',
1313
// Task configuration.
1414
concat: {
15-
options: {
16-
banner: '<%= banner %>',
17-
stripBanners: true
15+
core: {
16+
options: {
17+
banner: '<%= banner %>\nvar CSSLint = (function(){',
18+
footer: '\nreturn CSSLint;\n})();'
19+
},
20+
src: [
21+
'src/core/CSSLint.js',
22+
'src/core/*.js',
23+
'src/rules/*.js',
24+
'src/formatters/*.js'
25+
],
26+
dest: 'build/<%= pkg.name %>.js'
27+
},//Build environment workers
28+
rhino: {
29+
src: [
30+
'<%= concat.core.dest %>',
31+
'src/cli/{common, rhino}.js'
32+
],
33+
dest: 'build/<%= pkg.name %>-rhino.js'
1834
},
19-
dist: {
20-
src: ['lib/<%= pkg.name %>.js'],
21-
dest: 'dist/<%= pkg.name %>.js'
35+
node: {
36+
options: {
37+
banner: '<%= banner %>',
38+
footer: '\nexports.CSSLint = CSSLint;'
39+
},
40+
src: [
41+
'src/core/CSSLint.js',
42+
'src/core/*.js',
43+
'src/rules/*.js',
44+
'src/formatters/*.js'
45+
],
46+
dest: 'build/<%= pkg.name %>-node.js'
47+
},
48+
node_cli: {
49+
options: {
50+
banner: '#!/usr/bin/env node\n<%= banner %>'
51+
},
52+
src: [
53+
'src/cli/{common, node}.js'
54+
],
55+
dest: 'build/npm/cli.js'
56+
},
57+
worker: {
58+
options: {
59+
banner: '<%= banner %>'
60+
},
61+
src: [
62+
'src/core/CSSLint.js',
63+
'src/core/*.js',
64+
'src/rules/*.js',
65+
'src/formatters/*.js',
66+
'src/worker/*.js'
67+
],
68+
dest: 'build/<%= pkg.name %>-worker.js'
69+
},
70+
whs: {
71+
src: [
72+
'<%= concat.core.dest %>',
73+
'src/cli/{common, whs}.js'
74+
],
75+
dest: 'build/<%= pkg.name %>-whs.js'
76+
},//Build tests
77+
tests: {
78+
src: [
79+
'!tests/all-rules.js',
80+
'tests/**/*.js'
81+
],
82+
dest: 'build/npm/cli.js'
83+
},
84+
tests_node: {
85+
src: [
86+
'<%= concat.core.dest %>',
87+
'tests/**/*.js'
88+
],
89+
dest: 'build/npm/cli.js'
2290
}
2391
},
2492
uglify: {
@@ -61,7 +129,7 @@ module.exports = function(grunt) {
61129
src: ['src/**/*.js']
62130
},
63131
tests: {
64-
src: ['lib/**/*.js', 'test/**/*.js']
132+
src: ['test/**/*.js']
65133
}
66134
},
67135
watch: {

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
"name": "csslint",
33
"version": "v0.9.11-dev",
44
"description": "CSSLint",
5-
"author": "Nicholas C. Zakas",
5+
"author": {
6+
"name": "Nicholas C. Zakas"
7+
},
68
"contributors": [
7-
"Nicole Sullivan"
9+
{
10+
"name": "Nicole Sullivan"
11+
}
812
],
913
"engines": {
1014
"node": ">=0.2.0"

0 commit comments

Comments
 (0)