Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
0b2fe288
authored
2012-07-24 18:35:46 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add a banner to prepend to builds.
1 parent
4569d1c4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
grunt.js
grunt.js
View file @
0b2fe28
module
.
exports
=
function
(
grunt
)
{
grunt
.
initConfig
({
pkg
:
'<json:package.json>'
,
meta
:
{
banner
:
'// rivets.js\n'
+
'// version: <%= pkg.version %>\n'
+
'// author: <%= pkg.author %>\n'
+
'// license: <%= pkg.licenses[0].type %>'
},
lint
:
{
files
:
[
'grunt.js'
,
'lib/**/*.js'
,
'spec/**/*.js'
]
},
min
:
{
dist
:
{
src
:
'lib/rivets.js'
,
src
:
[
'<banner:meta.banner>'
,
'lib/rivets.js'
]
,
dest
:
'lib/rivets.min.js'
}
},
...
...
@@ -20,7 +28,8 @@ module.exports = function(grunt) {
grunt
.
registerTask
(
'compile'
,
'Compiles CoffeeScript source into JavaScript.'
,
function
(){
var
coffee
=
require
(
'coffee-script'
);
var
js
=
coffee
.
compile
(
grunt
.
file
.
read
(
'src/rivets.coffee'
));
if
(
js
)
grunt
.
file
.
write
(
'lib/rivets.js'
,
js
);
var
banner
=
grunt
.
task
.
directive
(
'<banner:meta.banner>'
,
function
()
{
return
null
;
});
if
(
js
)
grunt
.
file
.
write
(
'lib/rivets.js'
,
banner
+
js
);
});
grunt
.
registerTask
(
'build'
,
'compile min'
);
...
...
Please
register
or
sign in
to post a comment