https://github.com/aminnairi/rollup-plugin-external
Rollup plugin for automatically computing your external dependencies.
https://github.com/aminnairi/rollup-plugin-external
dependencies external plugin rollup
Last synced: 2 months ago
JSON representation
Rollup plugin for automatically computing your external dependencies.
- Host: GitHub
- URL: https://github.com/aminnairi/rollup-plugin-external
- Owner: aminnairi
- License: mit
- Created: 2021-02-09T17:55:34.000Z (over 5 years ago)
- Default Branch: development
- Last Pushed: 2021-02-09T19:00:54.000Z (over 5 years ago)
- Last Synced: 2025-03-02T11:41:51.823Z (over 1 year ago)
- Topics: dependencies, external, plugin, rollup
- Language: TypeScript
- Homepage: https://npmjs.com/@aminnairi/rollup-plugin-external
- Size: 86.9 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# @aminnairi/rollup-plugin-external
  
Rollup plugin for automatically computing your external dependencies.
## Summary
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [ECMAScript](#ecmascript)
- [TypeScript](#typescript)
- [Options](#options)
- [exclude](#exclude)
- [include](#include)
- [packageJsonPath](#packagejsonpath)
- [withBuiltinModules](#withbuiltinmodules)
- [withBundledDependencies](#withbundleddependencies)
- [withDependencies](#withdependencies)
- [withOptionalDependencies](#withoptionaldependencies)
- [withPeerDependencies](#withpeerdependencies)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [License](#license)
## Requirements
- [Node.js](https://nodejs.org/en/)
- [NPM](https://www.npmjs.com/)
## Installation
```console
$ npm install --save-dev @aminnairi/rollup-plugin-external
```
## Usage
### ECMAScript
```typescript
import {external} from "@aminnairi/rollup-plugin-external";
export default {
plugins: [
external()
]
};
```
### TypeScript
```typescript
import {external, ExternalOptions} from "@aminnairi/rollup-plugin-external";
const externalOptions: ExternalOptions = {
withBuiltinModules: false
};
export default {
plugins: [
external(externalOptions)
]
}
```
## Options
### exclude
Modules to exclude from the Rollup's `external` configuration (default to `[]`).
```typescript
external({
exclude: ["package", "to", "exclude"]
});
```
### include
Modules to include in the Rollup's `external` configuration (default to `[]`).
```typescript
external({
include: ["package", "to", "include"]
});
```
### packageJsonPath
Path to the module configuration (default to `package.json`).
```typescript
external({
packageJsonPath: "./settings/package.production.json"
});
```
### withBuiltinModules
Whether to include or not Node.js builtin modules in the Rollup's `external` configuration (default to `true`).
```typescript
external({
withBuiltinModules: false
});
```
### withBundledDependencies
Whether to include or not `bundledDependencies` in the Rollup's `external` configuration (default to `true`).
```typescript
external({
withBundledDependencies: false
});
```
### withDependencies
Whether to include or not `dependencies` in the Rollup's `external` configuration (default to `true`).
```typescript
external({
withDependencies: false
});
```
### withOptionalDependencies
Whether to include or not `optionalDependencies` in the Rollup's `external` configuration (default to `true`).
```typescript
external({
withOptionalDependencies: false
});
```
### withPeerDependencies
Whether to include or not `peerDependencies` in the Rollup's `external` configuration (default to `true`).
```typescript
external({
withPeerDependencies: false
});
```
## Changelog
See [`CHANGELOG.md`](./CHANGELOG.md)
## Contributing
See [`CONTRIBUTING.md`](./CONTRIBUTING.md)
## License
See [`LICENSE`](./LICENSE)