0.1.9 • Published 5 years ago

@atomico/rollup-pack v0.1.9

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

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
0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago

0.0.0

5 years ago