Permalink
Browse files

script for browser compile

  • Loading branch information...
1 parent bc56ca9 commit 5f4ba87be0520823dd2f31b495ba43eb1aaf415e @logicalparadox committed Dec 9, 2011
Showing with 31 additions and 0 deletions.
  1. +31 −0 support/compile.js
View
@@ -0,0 +1,31 @@
+var folio = require('folio')
+ , path = require('path')
+ , fs = require('fs');
+
+
+var oath = new folio.glossary([
+ path.join(__dirname, '..', 'lib', 'oath.js')
+ ], {
+ prefix: fs.readFileSync(path.join(__dirname, '..', 'lib', 'browser', 'prefix.js'), 'utf8'),
+ suffix: fs.readFileSync(path.join(__dirname, '..', 'lib', 'browser', 'suffix.js'), 'utf8')
+ });
+
+oath.compile(function (err, source) {
+ var copyright = fs.readFileSync(path.join(__dirname, '..', 'lib', 'browser', 'copyright.js'));
+ fs.writeFileSync(path.join(__dirname, '..', 'dist', 'oath.js'), copyright + '\n' + source);
+ console.log('Build successful: ' + '\toath.js');
+});
+
+var oath_min = new folio.glossary([
+ path.join(__dirname, '..', 'lib', 'oath.js')
+ ], {
+ minify: true,
+ prefix: fs.readFileSync(path.join(__dirname, '..', 'lib', 'browser', 'prefix.js'), 'utf8'),
+ suffix: fs.readFileSync(path.join(__dirname, '..', 'lib', 'browser', 'suffix.js'), 'utf8')
+ });
+
+oath_min.compile(function (err, source) {
+ var copyright = fs.readFileSync(path.join(__dirname, '..', 'lib', 'browser', 'copyright.js'));
+ fs.writeFileSync(path.join(__dirname, '..', 'dist', 'oath.min.js'), copyright + '\n' + source);
+ console.log('Build successful: ' + '\toath.min.js');
+});

0 comments on commit 5f4ba87

Please sign in to comment.