Skip to content

Commit 3943f5c

Browse files
terencehonlesalan-agius4
authored andcommitted
fix(@angular-devkit/build-angular): fix error with inline styles when running extract-i18n
When extracting inline styles in Angular 12 there seems to be no CSS loader specified and there will be something like the following message: angular-resource://:2:4 - Error: Module parse failed: Unexpected token (2:4) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | > :host { | display: block; | height: 0; This change adds a `webpack.NormalModuleReplacementPlugin` in extract-i18n for `angular-resource://` handling them as the non inline styles are handled. closes: #20750
1 parent da99ff9 commit 3943f5c

File tree

1 file changed

+4
-0
lines changed
  • packages/angular_devkit/build_angular/src/extract-i18n

1 file changed

+4
-0
lines changed

packages/angular_devkit/build_angular/src/extract-i18n/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ export async function execute(
237237
/\.(css|scss|sass|styl|less)$/,
238238
path.join(__dirname, 'empty-export-default.js'),
239239
),
240+
new webpack.NormalModuleReplacementPlugin(
241+
/^angular-resource:\/\//,
242+
path.join(__dirname, 'empty-export-default.js'),
243+
),
240244
],
241245
});
242246

0 commit comments

Comments
 (0)