Code Monkey home page Code Monkey logo

rollup-stream-gulp's Introduction

rollup-stream-gulp

A gulp plugin, and hopefully with enough work, love and consensus becomes @rollup/gulp

Installation

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().

// 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.

rollup-stream-gulp's People

Contributors

waynevanson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

rollup-stream-gulp's Issues

Fix this supposed bug

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.

I forgot what this was so I'll figure it out in case someone really uses it

multiple input file and output file

If I have multiple javascript file in my project lets say

src/

a.js
b.js

and then in gulpfile.js

gulp.src("src/*.js").pipe(rollup({})).pipe(gulp.dest("dist"));

so it got multiple file input instead of a single file. is it possible with this plugin to have multiple output like this?

dist/

a.min.js
b.min.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.