Skip to content

Commit 55200cf

Browse files
committed
bug(generate): ensure classes and imports are in lower case
Fixes angular#2833
1 parent b62b996 commit 55200cf

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/angular-cli/blueprints/component/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ module.exports = {
125125
const className = stringUtils.classify(`${options.entity.name}Component`);
126126
const fileName = stringUtils.dasherize(`${options.entity.name}.component`);
127127
const componentDir = path.relative(path.dirname(this.pathToModule), this.generatePath);
128-
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;
128+
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`.toLowerCase();
129129

130130
if (!options['skip-import']) {
131131
returns.push(

packages/angular-cli/blueprints/directive/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ module.exports = {
8888
const fullGeneratePath = path.join(this.project.root, this.generatePath);
8989
const moduleDir = path.parse(this.pathToModule).dir;
9090
const relativeDir = path.relative(moduleDir, fullGeneratePath);
91-
const importPath = relativeDir ? `./${relativeDir}/${fileName}` : `./${fileName}`;
91+
const importPath = relativeDir ? `./${relativeDir}/${fileName}` : `./${fileName}`.toLowerCase();
9292

9393
if (!options['skip-import']) {
9494
returns.push(

packages/angular-cli/blueprints/pipe/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module.exports = {
7676
const fullGeneratePath = path.join(this.project.root, this.generatePath);
7777
const moduleDir = path.parse(this.pathToModule).dir;
7878
const relativeDir = path.relative(moduleDir, fullGeneratePath);
79-
const importPath = relativeDir ? `./${relativeDir}/${fileName}` : `./${fileName}`;
79+
const importPath = relativeDir ? `./${relativeDir}/${fileName}` : `./${fileName}`.toLowerCase();
8080

8181
if (!options['skip-import']) {
8282
returns.push(

0 commit comments

Comments
 (0)