$ cnpm install gulp-rollup-lightweight
A Gulp plugin that makes working with Rollup easy!
It's a thin light-weight wrapper around the Rollup JS API that wraps the Rollup Promise in a Readable Stream.
npm install --save-dev gulp-rollup-lightweight
const { dest } = require('gulp');
const rollup = require('gulp-rollup-lightweight');
const source = require('vinyl-source-stream');
function bundle() {
return rollup({
input: './src/main.js',
output: {
format: 'umd'
}
})
.pipe(source('app.js'))
.pipe(dest('./dist'))
}
const { dest } = require('gulp');
const rollup = require('gulp-rollup-lightweight');
const source = require('vinyl-source-stream');
// Helps to resolve NPM modules
const resolve = require('rollup-plugin-node-resolve');
// Used for CJS resolution
const commonjs = require('rollup-plugin-commonjs')
function bundle() {
return rollup({
input: './src/main.js',
output: {
format: 'umd'
},
plugins: [
resolve(),
commonjs()
]
})
.pipe(source('app.js'))
.pipe(dest('./dist'))
}
const { dest } = require('gulp');
const rollup = require('gulp-rollup-lightweight');
const source = require('vinyl-source-stream');
function bundle() {
return rollup({
// Provide your custom Rollup
rollup: require('rollup'),
input: './src/main.js',
output: {
format: 'umd'
}
})
.pipe(source('app.js'))
.pipe(dest('./dist'))
}
Copyright 2014 - 2016 © taobao.org |