Pika/pack – NPM packaging, reimagined
pikapkg.com
pikapkg.com
That said, I feel like the authors made some choices that make their lives easier at the cost of having shipped a virtually useless tool. For example:
- The standard typescript builder can only generate ES2018
- The web bundler can only generate ES modules
These two together means that your package won't work on anywhere but the most modern browsers and Node versions, except if your package's users somehow configure their Webpack (or whatever) to run your module through Babel (totally beating the purpose of all this). This is exactly the kind of complication I'd want tools like these to solve for me.Sure, there's a place for the "this will only work on cutting edge environments", but i'm not sure a tool intended for publishing reusable libraries is that place.
Additionally, a core feature I miss is the ability to have different entry-points for different environments (eg one for node and one for browsers). My library uses the DOM for some heavy lifting and imports JSDOM on Node for that - I'd not want to ship JSDOM to the browser and bloat the download for no reason.
Hope all this improves, I could see myself using this.
Only field where I can see this being totally irrelevant is stuff like public sector/uptight corporate intranet with computer still on W7 without any other browser installed than IE9, or very high traffic/wide public stuff. Otherwise IE is starting to fall out of style faster and faster these days.
"build": "npm-run-all build",
"build:node": "parcel build -t node -d dist-node src/node-entry.ts",
"build:web": "parcel build -d dist-web src/web-entry.ts",
...which is a little extra boilerplate, but not too bad.> - The standard typescript builder can only generate ES2018
That's true, but only because the compilation to previous ES versions is meant to be handled by other plugins. For instance, the "web" plugin [1] uses babel-preset-env, which in turn will take your package.json's "browserslist" [2] into account.
> - The web bundler can only generate ES modules
The Pika project seems to be all about promoting ES modules, so it's no wonder that put this option to the forefront. However, there is also an UMD plugin [3] and a "node" (presumably Common.js) one [4].
[1]: https://github.com/pikapkg/builders/tree/master/packages/plu... [2]: https://github.com/browserslist/browserslist [3]: https://github.com/pikapkg/builders/tree/master/packages/plu... [4]: https://github.com/pikapkg/builders/tree/master/packages/plu...
npm install some-library -type umd
and have npm server handle this automatically.