fix: replace extension with .ngfactory.ts#4262
Closed
olivercs wants to merge 4 commits into
Closed
Conversation
Contributor
|
@olivercs Please check the build error. Also can this have an e2e test? Thanks. |
Author
|
@Meligy not sure how to do it. |
hansl
suggested changes
Feb 6, 2017
| const dirName = path.normalize(path.dirname(refactor.fileName)); | ||
| const entryModule = plugin.entryModule; | ||
| const entryModuleFileName = path.normalize(entryModule.path + '.ngfactory'); | ||
| const entryModuleFileName = path.normalize(entryModule.path.replace(/\.ts$/, '.ngfactory.ts')); |
Contributor
There was a problem hiding this comment.
This has a bug where the path does NOT include .ts at the end.
Author
There was a problem hiding this comment.
@hansl, is safe to append the string '.ngfactory.ts' in that particular case?
if( extension === '.ts' ) {
entryModuleFileName = path.normalize(entryModule.path.replace(/\.ts$/, '.ngfactory.ts'));
}else if(extension === '') {
entryModuleFileName = path.normalize(entryModule.path + '.ngfactory.ts');
}
hansl
suggested changes
May 24, 2017
|
|
||
| refactor.insertImport('platformBrowser', '@angular/platform-browser'); | ||
| refactor.insertImport(entryModule.className + 'NgFactory', ngFactoryPath); | ||
| refactor.insertImport(entryModule.className + 'NgFactory', ngFactoryPath + '.ngfactory.ts'); |
Contributor
There was a problem hiding this comment.
import A from 'some/path/file.ngfactory.ts'is wrong. You should not include the ts itself in the import path.
Contributor
|
Corresponding issue has been closed as obsolete, closing this PR. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix to issue #4238