Socket
Socket
Sign inDemoInstall

rollup-plugin-combine

Package Overview
Dependencies
1
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rollup-plugin-combine

A rollup plugin for combining dynamic JavaScript files which can be compiled into a library or application.


Version published
Weekly downloads
164
increased by92.94%
Maintainers
1
Install size
15.9 kB
Created
Weekly downloads
 

Readme

Source

rollup-plugin-combine

A rollup plugin for combining dynamic JavaScript files which can be compiled into a library or application.

Installation

npm install rollup-plugin-combine --save-dev

Usage

rollup.config.js

generate chunks

const match = require('rollup-plugin-match');
const empty = require('rollup-plugin-empty');
const combine = require('rollup-plugin-combine');

module.exports = [{
  input: 'src/*.js',
  plugins: [
    empty({
      silent: false,
      file: 'dist/cjs.js'
    }),
    match(),
    combine()
  ],
  output: {
    file: 'dist/cjs.js',
    format: 'cjs'
  }
}, {
  input: 'src/*.js',
  plugins: [
    empty({
      silent: false,
      file: 'dist/lib/**/*.js'
    }),
    match()
  ],
  output: {
    dir: 'dist/lib',
    format: 'cjs'
  }
}, {
  input: 'src/*.js',
  plugins: [
    empty({
      silent: false,
      dir: 'dist/es'
    }),
    match(),
    combine({
      outputDir: true
    })
  ],
  output: {
    dir: 'dist/es',
    format: 'es'
  }
}];

generate one chunk

const match = require('rollup-plugin-match');
const empty = require('rollup-plugin-empty');
const combine = require('rollup-plugin-combine');

module.exports = {
  input: 'src/*.js',
  plugins: [
    empty({
      silent: false,
      dir: 'dist'
    }),
    match(),
    combine()
  ],
  output: {
    file: 'dist/index.es.js',
    format: 'es'
  }
};

Options

  • main string (default: 'index.js') virtual entry
  • outputDir boolean generate chunks or not
  • exports string (default: 'named') 'import''named' or 'default'
  • camelCase object (optional) see here

Keywords

FAQs

Last updated on 14 Apr 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc