diff --git a/README.md b/README.md index c23793c..a866d5b 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,16 @@ module.exports = { } ``` +More details on the [official documentation](https://webpack.js.org/configuration/resolve). + +## Known incompatibilities + +This module does not play well with: + +- 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. +- [Jest](https://jestjs.io), which discards node's module system entirely to use it's own module system, bypassing module-alias. +- 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). + ## How it works? 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.