1.0.242 • Published 1 year ago
matrix-expand v1.0.242
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 snomiao@gmail.com Website: snomiao.com
Sponsors
- None yet.
Claim your sponsorship by donating snomiao <Email: snomiao@gmail.com>
Contribute
The main repo is in here, any issue and PR's welcome.