Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): fix error with inline styles when…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
terencehonles authored and alan-agius4 committed May 14, 2021
1 parent da99ff9 commit 3943f5c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ export async function execute(
/\.(css|scss|sass|styl|less)$/,
path.join(__dirname, 'empty-export-default.js'),
),
new webpack.NormalModuleReplacementPlugin(
/^angular-resource:\/\//,
path.join(__dirname, 'empty-export-default.js'),
),
],
});

Expand Down

0 comments on commit 3943f5c

Please sign in to comment.