一覧へ戻る
bedeoverend/rollup-plugin-file(新しいタブで開きます)
主要言語: JavaScript
Use a file as an entry point to rollup
- star 数
- 4
- watcher 数
- 1
- fork 数
- 0
- issue 数
- 0
- 最終更新
- 2016/09/26
主要言語: JavaScript
Use a file as an entry point to rollup
Rollup plugin to read a file (or vinyl) as an entry, rather than a string.
npm install --save-dev rollup-plugin-file
The entry file must have the base property. Any imports in the entry file will be looked for relative to the base filepath.
The below is a Gulp example, however it can be used with any file as long as it has the base property.
import rollupFile from 'rollup-plugin-file'; import rollup from 'rollup'; import gulp from 'gulp'; gulp.task('rollup', function() { return gulp.src('./src/*.js') .pipe(through(function(file, enc, done) { rollup({ entry: file, plugins: [ rollupFile() ] }) .then(function(bundle) { file.contents = new Buffer(bundle.generate(options).code); done(null, file); }) .catch(function(err) { done(err); }); })) .pipe(gulp.dest('./dist')); });
Use gulp-rollup-file
instead of this directly for Gulp, and use alongside gulp-process-inline to use Rollup with inline <script> blocks in HTML.
MIT © Bede Overend