vinyl-rollup
A wrapper for rollup that produces a stream of Vinyl objects.
Last updated a month ago by coreyfarrell .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install vinyl-rollup 
SYNC missed versions from official npm registry.

vinyl-rollup

Travis CI Greenkeeper badge NPM Version NPM Downloads MIT

A wrapper for rollup that produces a stream of Vinyl objects.

Install vinyl-rollup

This module requires node.js 8 or above. All testing is done using the esm loader.

Usage

This example shows use of esm with gulp.

npm i -D rollup vinyl-rollup gulp pump esm

Create gulpfile.esm.js.

import gulp from 'gulp';
import pump from 'pump';
import vinylRollup from 'vinyl-rollup';
import rollupConfig from './rollup.config.js';

export function build() {
	return pump(
		vinylRollup({
			rollup: rollupConfig,
			copyModules: true,
			modulePath: 'node_modules'
		}),
		gulp.dest('build', {sourcemaps: '.'})
	);
}

Create rollup.config.js for your application. See the rollup guide.

Option rollup

This object is used as the rollup configuration. If rollup.output.file is missing it will be set to the value of rollup.input. If rollup.output.vinylOpts is set it will be removed from the rollup output config and used as the default vinyl object options for the bundle output. This does not effect creation vinyl objects created for the copyModules option.

Option copyModules

By default this module will merge streams including package.json and license files from any external module that provided sources to the bundle. Setting copyModules to true will cause all files from these modules to be added to the stream, setting copyModules to false will disable copying any original files from bundled modules.

This option only has an effect if rollup is able to resolve 'external' modules. See rollup-plugin-node-resolve or rollup-plugin-babel with babel-plugin-bare-import-rewrite.

Option modulePath

Default value: 'node_modules'.

This is used by copyModules. Each bundled source is checked against this path so the list of included external modules can be calculated.

Running tests

Tests are provided by xo and ava.

npm install
npm test

Current Tags

  • 0.6.2                                ...           latest (a month ago)

11 Versions

  • 0.6.2                                ...           a month ago
  • 0.6.1                                ...           2 months ago
  • 0.6.0                                ...           3 months ago
  • 0.5.1                                ...           6 months ago
  • 0.5.0                                ...           6 months ago
  • 0.4.2                                ...           7 months ago
  • 0.4.1                                ...           9 months ago
  • 0.4.0                                ...           9 months ago
  • 0.3.0                                ...           9 months ago
  • 0.2.0                                ...           10 months ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 45
Dependencies (6)
Dev Dependencies (13)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |