@atomico/rollup-pack
rollup preconfiguration, used by Atomico
Last updated a year ago by uppercod .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @atomico/rollup-pack 
SYNC missed versions from official npm registry.

rollup-pack

This is a bundle prefiguration for Rollup that allows to generate code for the browser in MJS format and to know its cost in size.

The process is simple and is done thanks to @atomico/rollup-plugin-input-html

  1. the existing html files in the root are analyzed.
  2. it extracts the local script of the modules type, from the html files.
  3. Bundles are generated for each one based on the name of the HTML file. eg: ui-button.html will be ui-button.js.

through the process 2 bundle directories are generated:

  1. ./dist: copy the html and all its dependencies thanks to rollup-plugin-node-resolve and @atomico/rollup-plugin-input-html.
  2. ./lib : copy alone the js of export.

In both formats the cost of each bundle is taught thanks to @atomico/rollup-plugin-sizes.

Use

import pack from "@atomico/rollup-pack";

export default pack("*.html" /**,optionalConfig **/);

default configuration

let ignoreLog = ["CIRCULAR_DEPENDENCY", "UNRESOLVED_IMPORT"];

let defaultOptions = {
	dirDist: "./dist",
	dirDemo: "./lib",
	minifyDist: !isDev,
	minifyDemo: !isDev,
	showSizes: !isDev,
	plugins: [],
	pluginsDist: [],
	pluginsDemo: [],
	onwarn(message) {
		if (ignoreLog.indexOf(message.code) > -1) return;
		console.error(message);
	}
};

By default the configuration works thanks to the plugins.

  1. rollup-plugin-node-resolve
  2. rollup-plugin-terser
  3. @atomico/rollup-plugin-input-html
  4. @atomico/rollup-plugin-sizes

Current Tags

  • 0.1.9                                ...           latest (a year ago)

12 Versions

  • 0.1.9                                ...           a year ago
  • 0.1.8                                ...           a year ago
  • 0.1.7                                ...           a year ago
  • 0.1.6                                ...           a year ago
  • 0.1.5                                ...           a year ago
  • 0.1.4                                ...           a year ago
  • 0.1.3                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 0.0.1                                ...           a year ago
  • 0.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 12
Last Month 24
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |