Skip to content

Commit

Permalink
docs(Plugins): Added info about folder separator on windows (#7068)
Browse files Browse the repository at this point in the history
* Added info about folder separator on windows

see https://stackoverflow.com/a/56084864/4255158 for more context.
There should be info about this in the docs!

* simplified regex (removed unnecessary escape char)
  • Loading branch information
WhyINeedToFillUsername authored Nov 26, 2023
1 parent b93808f commit e1d9b7a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/content/plugins/normal-module-replacement-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ new webpack.NormalModuleReplacementPlugin(resourceRegExp, newResource);

Note that the `resourceRegExp` is tested against the request you write in your code, not the resolved resource. For instance, `'./sum'` will be used to test instead of `'./sum.js'` when you have code `import sum from './sum'`.

Also please note that when using Windows, you have to accomodate for the different folder separator symbol. E.g. `/src\/environments\/environment\.ts/` won't work on Windows, you have to use `/src[\\/]environments[\\/]environment\.ts/,` instead.

## Basic Example

Replace a specific module when building for a [development environment](/guides/production).
Expand Down

0 comments on commit e1d9b7a

Please sign in to comment.