You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
Copy file name to clipboardExpand all lines: src/content/plugins/normal-module-replacement-plugin.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,8 @@ new webpack.NormalModuleReplacementPlugin(resourceRegExp, newResource);
17
17
18
18
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'`.
19
19
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
+
20
22
## Basic Example
21
23
22
24
Replace a specific module when building for a [development environment](/guides/production).
0 commit comments