Home

Awesome

rollup-plugin-vinyl

Build Status Dependecies status

A rollup.js plugin to import from Vinyl files.

installation

npm i -D rollup-plugin-vinyl

Usage

import vinyl from 'rollup-plugin-vinyl';
import File from 'vinyl';

export default {
  entry: 'src/main.js',
  format: 'cjs',
  plugins: [

      // Single file
      vinyl({ files: new File({ ... }) }),

      // Multiple files
      vinyl({ files: [
          vinylFile1,
          vinylFile2,
          ...
      ] }),

      // Custom module resolution
      // This will resolve `import Module from 'lib/module'`
      // to `lib/module.ts` or `lib/module/index.ts`
      vinyl({
        extension: 'ts',
        files: ...
      })

  ],
  dest: 'bundle.js'
}

Test

git clone https://github.com/operandom/rollup-plugin-vinyl.git
cd rollup-plugin-vinyl
npm install
npm test

License

Released under the MIT license.