1.0.1 • Published 5 years ago

@anonym/rollup-plugin-legacy v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

rollup-plugin-legacy

Add export declarations to legacy non-module scripts. This module supports sourcemaps. See https://github.com/rollup/rollup-plugin-legacy/pull/3

Installation

npm install --save-dev rollup-plugin-legacy

Usage

// rollup.config.js
import legacy from 'rollup-plugin-legacy';

export default {
  entry: 'src/main.js',
  dest: 'bundle.js',
  format: 'iife',
  plugins: [
    legacy({
      // add a default export, corresponding to `someLibrary`
      'vendor/some-library.js': 'someLibrary',

      // add named exports
      'vendor/another-library.js': {
        foo: 'anotherLib.foo',
        bar: 'anotherLib.bar',
        baz: 'anotherLib.baz'
      }
    })
  ]
}

License

MIT

1.0.1

5 years ago

1.0.0

5 years ago