Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(build): parse module definitions for material only or general
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasBurleson committed Aug 24, 2015
1 parent d32270e commit e4ca61f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config/ngModuleData.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Regex adapted from https://github.com/ceymard/gulp-ngcompile

module.exports = function processContent(fileContent) {
var NG_MODULE_REGEX = /\.module\(('material\.[^']*'|"material\.[^"]*")\s*,(?:\s*\[([^\]]+)\])?/g;
module.exports = function processContent(fileContent, materialOnly) {
var NG_MODULE_REGEX = materialOnly ? /\.module\(('material\.[^']*'|"material\.[^"]*")\s*,(?:\s*\[([^\]]+)\])?/g : /\.module\(('[^']*'|"[^"]*")\s*,(?:\s*\[([^\]]+)\])?/g;
var match = NG_MODULE_REGEX.exec(fileContent || '');
var module = match && match[1] && match[1].slice(1, -1); //remove quotes
var depsMatch = match && match[2] && match[2].trim();
Expand Down
2 changes: 1 addition & 1 deletion scripts/gulp-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ exports.buildNgMaterialDefinition = function() {
var modulesSeen = [];
return through2.obj(function(file, enc, next) {
var moduleName;
if (moduleName = getModuleInfo(file.contents).module) {
if (moduleName = getModuleInfo(file.contents, true).module) {
modulesSeen.push(moduleName);
}
buffer.push(file);
Expand Down

0 comments on commit e4ca61f

Please sign in to comment.