Skip to content

Commit 823c30e

Browse files
committed
Fix browser build.
`clone` is using `module` which is undefined and results in a reference error in the browser.
1 parent 2701b88 commit 823c30e

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Gruntfile.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,25 @@ module.exports = function(grunt) {
6464
concat: {
6565
core: {
6666
options: {
67-
banner: "<%= banner %>" +
68-
//Hack for using the node version of parserlib
69-
"var exports = exports || {};\n" +
67+
banner: "<%= banner %>\n" +
68+
// Hack for using the node version of parserlib and clone
69+
"var module = module || {},\n" +
70+
" exports = exports || {};\n\n" +
7071
"var CSSLint = (function(){\n",
7172
footer: "\nreturn CSSLint;\n})();"
7273
},
7374
src: [
7475
"<%= core_files %>"
7576
],
76-
dest: "<%= build_dir %>/<%= pkg.name %>.js"
77+
dest: "<%= build_dir %>/csslint.js"
7778
},//Build environment workers
7879
rhino: {
7980
src: [
8081
"<%= concat.core.dest %>",
8182
"src/cli/common.js",
8283
"src/cli/rhino.js"
8384
],
84-
dest: "<%= build_dir %>/<%= pkg.name %>-rhino.js"
85+
dest: "<%= build_dir %>/csslint-rhino.js"
8586
},
8687
node: {
8788
options: {
@@ -91,7 +92,7 @@ module.exports = function(grunt) {
9192
footer: "\nexports.CSSLint = CSSLint;"
9293
},
9394
files: {
94-
"<%= build_dir %>/<%= pkg.name %>-node.js": ["<%= csslint_files %>"]
95+
"<%= build_dir %>/csslint-node.js": ["<%= csslint_files %>"]
9596
}
9697
},
9798
node_cli: {
@@ -109,7 +110,7 @@ module.exports = function(grunt) {
109110
"tests/**/*.js",
110111
"!tests/all-rules.js"
111112
],
112-
dest: "<%= build_dir %>/<%= pkg.name %>-tests.js"
113+
dest: "<%= build_dir %>/csslint-tests.js"
113114
},
114115
worker: {
115116
options: {
@@ -121,15 +122,15 @@ module.exports = function(grunt) {
121122
"<%= core_files %>",
122123
"src/worker/*.js"
123124
],
124-
dest: "<%= build_dir %>/<%= pkg.name %>-worker.js"
125+
dest: "<%= build_dir %>/csslint-worker.js"
125126
},
126127
wsh: {
127128
src: [
128129
"<%= concat.core.dest %>",
129130
"src/cli/common.js",
130131
"src/cli/wsh.js"
131132
],
132-
dest: "<%= build_dir %>/<%= pkg.name %>-wsh.js"
133+
dest: "<%= build_dir %>/csslint-wsh.js"
133134
}
134135
},
135136

0 commit comments

Comments
 (0)