rollup-worker
Rollup worker for multiple entry bundle with customize distributes.
Last updated 6 months ago by allex .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rollup-worker 
SYNC missed versions from official npm registry.

rollup-worker

Rollup worker for multiple entry bundle with customize distributes.

Installation

$

npm i -g rollup-worker@next

rollup-worker --config <CONFIG_FILE.js>

Usage

rollup config file

// cat .fssrc.js
import path from 'path'
import coffee from 'rollup-plugin-coffee-script'

const { version, name, author, dependencies } = require('./package.json')

// add some customize plugins with builtins
const plugins = [
  coffee(),
  'resolve',
  'commonjs'
]

const babelConfig = { ... }

module.exports = {
  rollup: {
    destDir: path.join(__dirname, './'),
    pluginOptions: {
      babel: (rollupCfg) => {
        const babelrc = Object.assign({}, babelConfig)
        if ([ 'es', 'cjs' ].includes(rollupCfg.output.format)) {
          babelrc.comments = true
        }
        return babelrc
      },
      nodeResolve: (rollupCfg) => {
        const format = rollupCfg.output.format
        return {
          preferBuiltins: false,
          customResolveOptions: {
            moduleDirectory: /min|umd|iife/.test(format) ? [ 'src', 'node_modules' ] : [ 'src' ]
          }
        }
      },
      uglifyjs: {
        ie8: false
      }
    },
    entry: [
      {
        input: './pace.coffee',
        plugins,
        output: [
          {
            format: 'es',
            file: 'pace.esm.js'
          },
          {
            format: 'umd',
            name: 'Pace',
            file: 'pace.js',
            banner: `/*! ${name} v${version} | ${license || 'MIT'} Licensed. | By ${author} */\n`
          }
        ]
      },
      {
        input: './docs/lib/themes.coffee',
        plugins,
        output: [
          {
            format: 'iife',
            minimize: true,
            file: 'docs/lib/themes.js'
          }
        ]
      }
    ]
  }
}
// cat build.js

'use strict'

const Rollup = require('rollup-worker')
const config = require('./.fssrc.js')

const worker = new Rollup(config.rollup)
worker.build().then(err => console.error(err))

License

MIT

Current Tags

  • 1.0.8                                ...           latest (6 months ago)
  • 1.0.9-beta.1                                ...           next (6 months ago)

22 Versions

  • 1.0.9-beta.1                                ...           6 months ago
  • 1.0.8                                ...           6 months ago
  • 1.0.7                                ...           9 months ago
  • 1.0.7-beta.4                                ...           a year ago
  • 1.0.7-beta.3                                ...           a year ago
  • 1.0.7-beta.2                                ...           a year ago
  • 1.0.7-beta.1                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.6-beta.6                                ...           a year ago
  • 1.0.6-beta.5                                ...           a year ago
  • 1.0.6-beta.4                                ...           a year ago
  • 1.0.6-beta.3                                ...           a year ago
  • 1.0.6-beta.2                                ...           a year ago
  • 1.0.6-beta.1                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.4-beta.2                                ...           a year ago
  • 1.0.4-beta.1                                ...           a year ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 23
This Month 31
Last Day 22
Last Week 3
Last Month 10
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |