rollup-plugin-atomic
Rollup plugin used in atom-ide-community
Last updated 2 months ago by atom-ide-community .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rollup-plugin-atomic 
SYNC missed versions from official npm registry.

rollup-plugin-atomic

Rollup plugin used in atom-ide-community

Installation

npm install --save-dev rollup-plugin-atomic

You should also install the peer dependencies:

"rollup": "2.21.0",
"typescript": "^3.9.6",
"coffeescript": "^1.12.7",
"@babel/core": "^7.10.5",

Usage

Create a rollup.config.js file at the root of the project with the following content. See API section for more details

const { createPlugins, createConfig } = require("rollup-plugin-atomic");

const plugins = createPlugins(["ts", "js"], true);

const config = createConfig(
  "src/main.ts",
  "dist",
  "cjs",
  ["atom", "electron", "node-pty-prebuilt-multiarch"],
  plugins
);

module.exports = config;

API

use createPlugins to create the plugins you need.

createPlugins(
  languages: Array<string> = ["ts", "js", "json", "coffee"], // languages you use
  babel: boolean = true,     // if you want to use babel
  extraPlugins?: Array<any>	// pass any extra plugins functions like `multientry()`
)

use createConfig to create the configs you need

createConfig(
  input: string | Array<string> = "src/main.ts", // bundle's input(s) file(s)
  output_dir: string = "dist",	// where the bundle is stored
  output_format = "cjs",  // output format (e.g. `cjs`, `es`, etc)
  externals: Array<string> = ["atom", "electron"], // libraries you want to be external
  plugins = createPlugins() // pass the plugins you created using `createPlugins()`
)

You can create multiple configs using createConfig and export them as an array:

module.exports = [config1, config2]

Only using createPlugins:

you can only use createPlugins and then export your config with the typical rollup style:

const { createPlugins } = require("rollup-plugin-atomic");

const plugins = createPlugins(["ts", "js"], true);

module.exports = {
    input: "src/main.ts",
    output: [
      {
        dir: "dist",
        format: "cjs",
        sourcemap: true,
      },
    ],
    plugins: plugins,
}

Current Tags

  • 1.0.2                                ...           latest (2 months ago)

4 Versions

  • 1.0.2                                ...           2 months ago
  • 1.0.1                                ...           2 months ago
  • 1.0.0                                ...           2 months ago
  • 0.1.0                                ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |