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

Commit

Permalink
update README to use config file conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Oct 19, 2017
1 parent d5a922c commit ac38b0d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@ $ npm install rollup-plugin-alias

## Usage
```javascript
import { rollup } from 'rollup';
// rollup.config.js
import alias from 'rollup-plugin-alias';

rollup({
entry: './src/index.js',
export default {
input: './src/index.js',
plugins: [alias({
somelibrary: './mylocallibrary'
})],
});
};
```

An optional `resolve` array with file extensions can be provided.
If present local aliases beginning with `./` will be resolved to existing files:

```javascript
import { rollup } from 'rollup';
// rollup.config.js
import alias from 'rollup-plugin-alias';

rollup({
entry: './src/index.js',
export default {
input: './src/index.js',
plugins: [alias({
resolve: ['.jsx', '.js'],
foo: './bar' // Will check for ./bar.jsx and ./bar.js
})],
});
};
```
If not given local aliases will be resolved with a `.js` extension.

Expand Down

0 comments on commit ac38b0d

Please sign in to comment.