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
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
# babel-plugin-module-resolver
2
2
[![Maintenance Status][status-image]][status-url][![NPM version][npm-image]][npm-url][![Build Status Linux][circleci-image]][circleci-url][![Build Status Windows][appveyor-image]][appveyor-url][![Coverage Status][coverage-image]][coverage-url]
3
3
4
-
A [babel](http://babeljs.io) plugin to add a new resolver for your modules when compiling your code using Babel. The plugin allows you to add new "root" directories that contains your modules. It also allows you to setup custom alias which can also be directories or specific files, or even other npm modules.
4
+
A [Babel](http://babeljs.io) plugin to add a new resolver for your modules when compiling your code using Babel. This plugin allows you to add new "root" directories that contain your modules. It also allows you to setup a custom alias for directories, specific files, or even other npm modules.
5
5
6
6
## Description
7
7
8
-
The reason of this plugin is to simplify the require/import paths in your project. Therefore, instead of using complex relative paths like `../../../../utils/my-utils`, you would be able to write `utils/my-utils`. It will allow you to work faster since you won't need to calculate how many levels of directory you have to go up before accessing the file.
8
+
This plugin can simplify the require/import paths in your project. For example, instead of using complex relative paths like `../../../../utils/my-utils`, you can write `utils/my-utils`. It will allow you to work faster since you won't need to calculate how many levels of directory you have to go up before accessing the file.
9
9
10
10
```js
11
11
// Use this:
@@ -57,7 +57,7 @@ Specify the plugin in your `.babelrc` with the custom root or alias. Here's an e
57
57
58
58
babel-plugin-module-resolver is a new version of the old babel-plugin-module-alias. Therefore, you also need to make a few modifications to your plugin configuration to make it work with this new plugin.
59
59
60
-
Updating is very easy, so for example if you had this configuration:
60
+
Updating is very easy. For example, if you had this configuration:
61
61
```json
62
62
// This configuration is outdated, this is just an example
63
63
{
@@ -87,11 +87,11 @@ You only have to update the plugin options to be like this:
87
87
88
88
## ESLint plugin
89
89
90
-
If you're using ESLint, you should use the [eslint-plugin-import][eslint-plugin-import], and this [eslint-import-resolver-babel-module][eslint-import-resolver-babel-module] in order to remove falsy unresolved modules.
90
+
If you're using ESLint, you should use [eslint-plugin-import][eslint-plugin-import], and [eslint-import-resolver-babel-module][eslint-import-resolver-babel-module] to remove falsy unresolved modules.
91
91
92
92
## Usage with Flow
93
93
94
-
To allow Flow to find your modules it is necessary to add configuration options
94
+
To allow Flow to find your modules, add configuration options
95
95
to `.flowconfig`.
96
96
97
97
For example, a React component is located at `src/components/Component.js`
0 commit comments