Skip to content

Commit

Permalink
handle if .bowerrc does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
kristw committed Mar 1, 2016
1 parent 8cfb3dc commit 708fe75
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions webpack.config.js
Expand Up @@ -2,12 +2,15 @@ var webpack = require('webpack');
var fs = require('fs');

var bowerPath = 'bower_components';
if(fs.statSync(__dirname + '/.bowerrc')){
var bowerrc = JSON.parse(fs.readFileSync(__dirname + '/.bowerrc', 'utf-8'));
if(bowerrc.directory){
bowerPath = __dirname + '/' + bowerrc.directory;
try{
if(fs.statSync(__dirname + '/.bowerrc')){
var bowerrc = JSON.parse(fs.readFileSync(__dirname + '/.bowerrc', 'utf-8'));
if(bowerrc.directory){
bowerPath = __dirname + '/' + bowerrc.directory;
}
}
}
catch(ex){}

module.exports = function(){
return {
Expand Down

0 comments on commit 708fe75

Please sign in to comment.