Skip to content

Commit

Permalink
Issue #6 exclude css files in a test directory from being included in…
Browse files Browse the repository at this point in the history
… the vendor.css file
  • Loading branch information
mrkmiller committed Feb 20, 2019
1 parent be75086 commit 2c31f4d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gulp_tasks/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module.exports = function (gulp, config, tasks) {
mainFileDir = mainFileDir + '/dist';
} else {
// Parse the main file and get its directory to look for a "dist" directory.
var depPackageBuffer = fs.readFileSync('./node_modules/' + lib + '/package.json');
var depPackageBuffer = fs.readFileSync(mainFileDir + '/package.json');
var depPackage = JSON.parse(depPackageBuffer.toString());

if (depPackage.main) {
Expand All @@ -86,9 +86,11 @@ module.exports = function (gulp, config, tasks) {
}

// Add all CSS files
sources.push(mainFileDir + '/**/*.css')
sources.push(mainFileDir + '/**/*.css');
// Ignore minified CSS files.
sources.push('!' + mainFileDir + '/**/*.min.css')
sources.push('!' + mainFileDir + '/**/*.min.css');
// Ignore CSS files in a /test or /tests directory.
sources.push('!' + mainFileDir + '/(test|tests)/**/*');
}

sources = sources.concat(config.css.vendor);
Expand Down

0 comments on commit 2c31f4d

Please sign in to comment.