Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/waynevanson/rollup-stream-gulp
Implentation of Rollup as a stream and Rollup as a Gulp plugin
https://github.com/waynevanson/rollup-stream-gulp
gulp gulpplugin node rollup streams typescript
Last synced: about 1 month ago
JSON representation
Implentation of Rollup as a stream and Rollup as a Gulp plugin
- Host: GitHub
- URL: https://github.com/waynevanson/rollup-stream-gulp
- Owner: waynevanson
- License: mit
- Created: 2021-06-06T11:49:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-10T10:20:14.000Z (over 3 years ago)
- Last Synced: 2024-11-30T16:42:00.172Z (about 1 month ago)
- Topics: gulp, gulpplugin, node, rollup, streams, typescript
- Language: TypeScript
- Homepage:
- Size: 313 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# rollup-stream-gulp
A gulp plugin, and hopefully with enough work, love and consensus becomes `@rollup/gulp`
## Installation
```sh
yarn add -D rollup-stream-gulp
```## Purpose
Currently the recommended way is to use `@rollup/stream`. This works well, but has a few limitations.
- `requires \`vinyl-source-stream\``
- Outputs utf-8 only and not the chunks containing rollup metadata
- only allows outputing one file per stream instance
- `options.manualChunks` not supported
- DX is non-optimal## Usage
Accepts all the `RollupOption`'s excluding `input`, which is gathered from `gulp.src()`.
```ts
// gulpfile.ts
import gulp from "gulp";
import rollup from "rollup-stream-gulp";
// import rollup from "@rollup/gulp";// generates two files, both in different formats under the `dist` directory.
export const build = async () =>
gulp
.src("src/index.ts")
.pipe(
rollup({
output: [
{ file: "index.js", format: "cjs" },
{ file: "index.mjs", format: "esm" },
],
})
)
.pipe(gulp.dest("dist"));
```## Troubleshooting, Validation and Errors
There are a few caveats.
Internally we use `options.input = file.path`, which means we may not get errors about file conflicts.
We'll be looking to address these later on.