-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Labels
area: @angular-devkit/build-angularfeatureIssue that requests a new featureIssue that requests a new featuretype: RFC / discussion / questiontype: faq
Milestone
Description
Versions
@ngtools/webpack: 6.0.0-beta.4
Repro steps
- Create app with lazy loaded routes where modules are in some subdirectory (not in the root directory).
- Compile app using webpack AngularCompilerPlugin with nameLazyFiles set to true + output.chunkFilename set to '[name].chunk.js',
Observed behavior
Relative filesystem path to the compiled module is:
.\SubjectCommon\js\controllers\credit\credit.module.ts
and the name of the coresponding chunk is:
SubjectCommon-js-controllers-credit-credit-module-ngfactory.chunk.js
Desired behavior
Chunk name should be:
credit.module.chunk.js
Mention any other details that might be useful (optional)
I belive that option "nameLazyFiles" should replace existing plugin NamedLazyChunksWebpackPlugin (from previous version of CLI). But it works differently. NamedLazyChunksWebpackPlugin generated correct name "credit.module.chunk.js".
The problem is on this line:
const name = importPath.replace(/(\.ngfactory)?\.(js|ts)$/, ''); |
"importPath" contains path to the factory file without any extension (regex is not correct because it expect extension). And just the name of the factory file should be used. Not whole path.
shrujal-shah, haskelcurry and Saeed-Khamseh
Metadata
Metadata
Assignees
Labels
area: @angular-devkit/build-angularfeatureIssue that requests a new featureIssue that requests a new featuretype: RFC / discussion / questiontype: faq