aboutsummaryrefslogtreecommitdiff
path: root/grunt
diff options
context:
space:
mode:
authorJames Friend <[email protected]>2014-08-28 09:39:41 +0800
committerJames Friend <[email protected]>2014-08-28 09:39:41 +0800
commit015ee2ed74bcdc48eea9bb7f6bb453f1c2f182aa (patch)
tree5388c7206375ba5b69b31ef70da0803a97d0e392 /grunt
parent9aeaf19b1dca68ee71e916ae415a0c270a47d301 (diff)
downloadbootstrap-015ee2ed74bcdc48eea9bb7f6bb453f1c2f182aa.tar.xz
bootstrap-015ee2ed74bcdc48eea9bb7f6bb453f1c2f182aa.zip
pulled output path out to gruntfile
Diffstat (limited to 'grunt')
-rw-r--r--grunt/bs-commonjs-generator.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/grunt/bs-commonjs-generator.js b/grunt/bs-commonjs-generator.js
index 0a76333d9..8ab309b33 100644
--- a/grunt/bs-commonjs-generator.js
+++ b/grunt/bs-commonjs-generator.js
@@ -2,17 +2,16 @@
var fs = require('fs');
var path = require('path');
-var destDir = 'dist/js';
-var destFilename = 'npm.js';
-var destFilepath = path.join(destDir, destFilename);
+module.exports = function generateCommonJSModule(grunt, srcFiles, destFilepath) {
+ var destDir = path.dirname(destFilepath);
-function srcPathToDestRequire(srcFilepath) {
- var requirePath = path.relative(destDir, srcFilepath);
- return "require('"+requirePath+"')";
-}
+ function srcPathToDestRequire(srcFilepath) {
+ var requirePath = path.relative(destDir, srcFilepath);
+ return "require('"+requirePath+"')";
+ }
-module.exports = function generateCommonJSModule(grunt, files) {
- var moduleOutputJs = files.map(srcPathToDestRequire).join('\n');
+ var moduleOutputJs = srcFiles.map(srcPathToDestRequire).join('\n');
+
try {
fs.writeFileSync(destFilepath, moduleOutputJs);
}