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

Commit 391cff5

Browse files
fix(build): buildNgMaterialDefinition RegExp updated
update buildNgMaterialDefinition() regExp to search for module definitions of 'material.*'. excludes any extraneous, demo-related module definitions. use `material.layout` to match `material.animate` Fixes #4305.
1 parent d5c3edb commit 391cff5

File tree

6 files changed

+5
-11
lines changed

6 files changed

+5
-11
lines changed

config/ngModuleData.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Regex adapted from https://github.com/ceymard/gulp-ngcompile
22

33
module.exports = function processContent(fileContent) {
4-
var NG_MODULE_REGEX = /\.module\(('[^']*'|"[^"]*")\s*,(?:\s*\[([^\]]+)\])?/g;
4+
var NG_MODULE_REGEX = /\.module\((['|"]\material\..*'|"[^"]*")\s*,?\s*\[(([^\]]+)\])?/g;
55
var match = NG_MODULE_REGEX.exec(fileContent || '');
66
var module = match && match[1] && match[1].slice(1, -1); //remove quotes
77
var depsMatch = match && match[2] && match[2].trim();

gulp/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function readModuleArg() {
179179

180180
function filterNonCodeFiles() {
181181
return filter(function(file) {
182-
return !/demo|module\.json|\.spec.js|README/.test(file.path);
182+
return !/demo|module\.json|script\.js|\.spec.js|README/.test(file.path);
183183
});
184184
}
185185

src/components/icon/js/iconDirective.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/**
2-
* @ngdoc directive
3-
* @name material.components.icon
4-
* @description
5-
* Icon
6-
*/
71
angular
82
.module('material.components.icon')
93
.directive('mdIcon', ['$mdIcon', '$mdTheming', '$mdAria', mdIconDirective]);

src/core/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ angular
66
.module('material.core', [
77
'ngAnimate',
88
'material.animate',
9+
'material.layout',
910
'material.core.gestures',
10-
'material.core.layout',
1111
'material.core.theming'
1212
])
1313
.directive('mdTemplate', MdTemplateDirective)

src/core/services/layout/layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* }
4242
* ```
4343
*/
44-
angular.module('material.core.layout', [ ])
44+
angular.module('material.layout', [ ])
4545

4646
// Attribute directives with optional value(s)
4747

src/core/services/layout/layout.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('layout directives', function() {
22

3-
beforeEach(module('material.core'));
3+
beforeEach(module('material.core', 'material.layout'));
44

55
describe('expecting layout classes', function() {
66

0 commit comments

Comments
 (0)