Originally my colleague posted a short review about Pika/Pack on Syndicode blog. I decided to make my own review for this tool here.
Writing about npm I have seen a lot of cool tools you can use to simplify your work. Unfortunately, it's even harder to choose from rather than to find one.
But sometimes I bump into something like @pika/pack. So I think this one can be chosen and recommended for sure.
@pika/pack is an npm package builder that connects pre-configured plugins to build and optimize your package. Plugins wrap already-popular tools like Babel and Rollup with options already optimized for npm.
Among its features:
- Simplicity - The plugins to choose from are already pre-configured.
- Flexibility - You can choose any plugins and optimizations.
- Holism - It lets you build the entire package including code, assets and even package.json.
By building the entire package, you end up with a fully-built pkg/ directory, ready to publish. Entry points like 'main', 'module', 'umd:main', 'types', 'unpkg', and advanced options like 'sideEffects' and 'files' are handled by your build plugins.
Available Source, Distribution, Community, Advanced and WASM Builders can be found on Pika/Pack Github page.
The first plugin that most packages will use is @pika/plugin-standard-pkg. This is a standard 'source' builder that builds any JS & TS source code to the latest ES2018 language spec. After creating your modern ES2018 build, it becomes trivial to add Node.js - and web-optimized distributions to your package. @pika/plugin-build-node will transpile a Node.js-ready distribution to run on any supported Node.js version. With @pika/pack, every package automatically gets .d.ts TypeScript definition files thanks to the @pika/plugin-build-types plugin.
It sounds quite promising. Try it out and tell me your opinion on this project!
You can go through the introduction to Pika/Pack on its website.
And check my regular JS digests to find more of interesting tools and repositories!