Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/grunt
diff options
context:
space:
mode:
authorJames Friend <james.friend@agworld.com.au>2014-08-28 05:39:41 +0400
committerJames Friend <james.friend@agworld.com.au>2014-08-28 05:39:41 +0400
commit015ee2ed74bcdc48eea9bb7f6bb453f1c2f182aa (patch)
tree5388c7206375ba5b69b31ef70da0803a97d0e392 /grunt
parent9aeaf19b1dca68ee71e916ae415a0c270a47d301 (diff)
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 0a76333d92..8ab309b332 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);
}