Skip to content

Andarist/preconstruct

 
 

Repository files navigation

🎁 preconstruct

A smart bundler for libraries

  • works well with monorepos
  • minimal to no config
  • lots of build time optimistions
  • uses rollup under the hood
  • opinionated

THIS IS NOT READY, THIS IS JUST WHAT IT SHOULD LOOK LIKE IN THE FUTURE

Install

yarn add --dev preconstruct

Usage

preconstruct init
  • Setup package.json with "main" and "module"
  • Setup packages if in monorepo
  • probably ask other things
preconstruct build
  • verifies things
    • if typeof document or typeof window is used, prompt to add browser field
  • does the build
preconstruct watch
  • same as build but watches
preconstruct fix
  • like init but infers as much as possible
  • made for places that already have build setups
  • e.g. if the package has a umd:main field and it's wrong, fix it and ask for a umdName but if it doesn't hava umd:main field, don't do anything

Ideas

  • good, reliable caching
  • use users babel config
  • allow for other entrypoints, automatically generate folders with package.json
  • opinionated dist folder structure with verification if it's wrong

Thanks/Inspiration

  • microbundle was a huge inspiration for this! ❤️
  • rollup
  • bolt - lots of utils and things in this project were inspired by things in bolt
  • all the people who wrote all the dependencies for this project!

About

🎁 A smart bundler for libraries

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%