Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Commit e0d1694

Browse files
committed
Update readme, fixes #4
1 parent 8245ece commit e0d1694

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,25 @@ Define aliases when bundling packages with Rollup.
33

44
[![Build Status](https://travis-ci.org/frostney/rollup-plugin-alias.svg?branch=master)](https://travis-ci.org/frostney/rollup-plugin-alias) [![Dependency Status](https://david-dm.org/frostney/rollup-plugin-alias.svg)](https://david-dm.org/frostney/rollup-plugin-alias) [![devDependency Status](https://david-dm.org/frostney/rollup-plugin-alias/dev-status.svg)](https://david-dm.org/frostney/rollup-plugin-alias#info=devDependencies) [![Coverage Status](https://coveralls.io/repos/github/frostney/rollup-plugin-alias/badge.svg?branch=master)](https://coveralls.io/github/frostney/rollup-plugin-alias?branch=master)
55

6+
Let's take a simple import as an example:
7+
8+
```javascript
9+
import something from '../../../something';
10+
11+
something();
12+
```
13+
14+
This probably doesn't look too bad on its own. But imagine this is not the only instance in your code base and after a refactor/restructuring this might fall over. With this plugin in place, you can alias `../../../something` with `something` for readability. In case of a refactor only the alias would need to be changed instead of navigating through the code base and changing all imports.
15+
16+
```javascript
17+
import something from 'something';
18+
19+
something();
20+
```
21+
622
When we write tests, we may want an easier way to access the local library we are testing or mocking libraries. We may also define aliases to counteract "require hell" and get rid of all those `../../../` imports we may have in the process.
723

8-
For Webpack users: This is a plugin to have a `resolve.alias` functionality in Rollup.
24+
For Webpack users: This is a plugin to mimic the `resolve.alias` functionality in Rollup.
925

1026
## Installation
1127
```

0 commit comments

Comments
 (0)