matrix-expand
v1.0.242
Published
Expand map of arrays to matrix (array of maps).
Readme
Matrix Expand
Expand map of arrays to matrix (array of maps).
Example
import matrixExpand from "matrix-expand";
const matrix = {
minify: [false, true],
format: ["esm", "cjs"],
entryName: ["cli", "index", null].filter(Boolean),
};
const expanded = matrixExpand(matrix);
const buildOpts = expanded.map(({ entryName, format, minify }) => {
const ext = { esm: ".mjs", cjs: ".cjs", iife: ".user.cjs" }[format];
return {
format,
minify,
entryPoints: [`src/${entryName}.ts`],
outfile: `dist/${entryName}${minify ? ".min" : ""}${ext}`,
jsx: "automatic",
};
});About
License
GPLv3 - The GNU General Public License v3.0 - GNU Project - Free Software Foundation
Author
Author: snomiao [email protected] Website: snomiao.com
Sponsors
- None yet.
Claim your sponsorship by donating snomiao <Email: [email protected]>
Contribute
The main repo is in here, any issue and PR's welcome.
