Skip to content

Commit

Permalink
Fixing first build issue, updating gitignore.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Vilk committed Mar 25, 2014
1 parent a82036a commit 3254977
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
node_modules/*
lib/*
tmp/*
doc/*
*.DS_Store
*.log
Expand All @@ -12,3 +10,4 @@ test/harness/load_fixtures.js
!test/fixtures/README.md
tscommand*
tools/*.js*
build/*
14 changes: 10 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
var fs = require('fs'),
path = require('path');

if (!fs.existsSync('build')) {
fs.mkdirSync('build');
}

/**
* Removes a directory if it exists.
* Throws an exception if deletion fails.
Expand Down Expand Up @@ -48,7 +52,8 @@ function getEssentialModules() {
* of the library.
*/
function getIntro() {
return "(function() {" + fs.readFileSync('build/dev/core/polyfills.js', 'utf8');
fs.writeFileSync('build/intro.frag', "(function() {");
return 'build/intro.frag';
}

/**
Expand All @@ -64,7 +69,8 @@ function getOutro() {
outro.push("require('" + modules[i] + "');");
}
outro.push("})();");
return outro.join("");
fs.writeFileSync('build/outro.frag', outro.join(""));
return 'build/outro.frag';
}

// Removes a file if it exists.
Expand Down Expand Up @@ -121,8 +127,8 @@ module.exports = function(grunt) {
// The main module that installs the BrowserFS global and needed polyfills.
name: '../../vendor/almond/almond',
wrap: {
start: getIntro(),
end: getOutro()
startFile: [getIntro(), 'build/dev/core/polyfills.js'],
endFile: [getOutro()]
},
out: 'build/release/browserfs.js',
optimize: 'uglify2',
Expand Down

0 comments on commit 3254977

Please sign in to comment.