Skip to content

Commit ae7a2bd

Browse files
authored
Merge branch 'dev' into dev
2 parents 4f0d797 + 40773e8 commit ae7a2bd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ module.exports = {
143143
}
144144
```
145145

146+
More details on the [official documentation](https://webpack.js.org/configuration/resolve).
147+
146148
## Usage with Jest
147149

148150
Unfortunately, `module-alias` itself would not work from Jest due to a custom behavior of Jest's `require`. But you can use it's own aliasing mechanism instead. The configuration can be defined either in `package.json` or `jest.config.js`. The example below is for `package.json`:
@@ -156,6 +158,13 @@ Unfortunately, `module-alias` itself would not work from Jest due to a custom be
156158
}
157159
```
158160

161+
## Known incompatibilities
162+
163+
This module does not play well with:
164+
165+
- Front-end JavaScript code. Module-alias is designed for server side so do not expect it to work with front-end frameworks (React, Vue, ...) as they tend to use Webpack. Use Webpack's [resolve.alias](https://webpack.js.org/configuration/resolve/#resolvealias) mechanism instead.
166+
- [Jest](https://jestjs.io), which discards node's module system entirely to use it's own module system, bypassing module-alias.
167+
- The [NCC compiler](https://github.com/zeit/ncc), as it uses WebPack under the hood without exposing properties, such as resolve.alias. It is not [something they wish to do](https://github.com/zeit/ncc/pull/460).
159168

160169
## How it works?
161170

0 commit comments

Comments
 (0)