Skip to content

Commit 40773e8

Browse files
authored
Merge pull request #83 from ilearnio/doc/incompatibilities
Update doc: add known incompatible tools
2 parents c82d4bb + 6cd3de3 commit 40773e8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

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

146+
More details on the [official documentation](https://webpack.js.org/configuration/resolve).
147+
148+
## Known incompatibilities
149+
150+
This module does not play well with:
151+
152+
- 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.
153+
- [Jest](https://jestjs.io), which discards node's module system entirely to use it's own module system, bypassing module-alias.
154+
- 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).
155+
146156
## How it works?
147157

148158
In order to register an alias it modifies the internal `Module._resolveFilename` method so that when you use `require` or `import` it first checks whether the given string starts with one of the registered aliases, if so, it replaces the alias in the string with the target path of the alias.

0 commit comments

Comments
 (0)