Skip to content

Commit e1d9b7a

Browse files
docs(Plugins): Added info about folder separator on windows (#7068)
* 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)
1 parent b93808f commit e1d9b7a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/content/plugins/normal-module-replacement-plugin.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ new webpack.NormalModuleReplacementPlugin(resourceRegExp, newResource);
1717

1818
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'`.
1919

20+
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.
21+
2022
## Basic Example
2123

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

0 commit comments

Comments
 (0)