Skip to content

Commit

Permalink
Merge pull request #962 from vwxyutarooo/feature/valiable-bemtojade-path
Browse files Browse the repository at this point in the history
#961 Tweak bemto.jade path dynamically
  • Loading branch information
Junaid Rasheed authored Aug 2, 2016
2 parents 5ce1a29 + 783d29b commit 632a36e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/styleguide.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ var path = require('path'),
distPath = path.join(__dirname, 'dist'),
fileHashes = {},
jadeCache,
serverInstance;
serverInstance,
bemtoPath = require.resolve('bemto.jade');

function socketIsOpen() {
return serverInstance && serverInstance.io;
Expand Down Expand Up @@ -90,8 +91,11 @@ function groupModuleFiles(allModules) {
function generateJadeMarkup(json, options) {
jadeCache = new LocalCache(path.resolve(options.rootPath, 'jadecache.json'));

var rootPath = path.resolve(__dirname, '../');
rootPath = path.relative(rootPath, bemtoPath);

// path to bemto
var bemtoinclude = 'include ./node_modules/bemto.jade/bemto.jade\n',
var bemtoinclude = 'include ./' + rootPath + '\n',
jadeOptions = {
filename: __dirname,
basedir: process.cwd(),
Expand Down

0 comments on commit 632a36e

Please sign in to comment.