npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@preconstruct/cli

v2.8.10

Published

Dev and build your code painlessly in monorepos

Downloads

85,031

Readme

Preconstruct 🎁

Dev and build your code painlessly in monorepos

Key Features

  • In dev mode, your code behaves the same as it will in production, including locally linked in monorepos
  • Add multiple entrypoints to your packages for publishing
  • CLI helps walk you through set-up and making changes to your configs
  • Works with different kinds of JS monorepos
  • Also works for single package repos!
  • Builds your code with rollup

Getting Started

Assuming you already have a source file at src/index.js (or src/index.ts) or you're using Yarn Workspaces and have packages with src/index.js (or src/index.ts), you can setup Preconstruct like this.

yarn add --dev @preconstruct/cli
yarn preconstruct init

If you're in a monorepo, you should also run yarn preconstruct dev and add it to a postinstall script("postinstall": "preconstruct dev") that runs preconstruct dev so that you can import your code without having to rebuild your project every time in changes.

Publishing packages

Before you publish packages to npm, run preconstruct build. reconstruct will use your Babel config and build flat bundles so make sure to configure Babel with the transforms you want.

We strongly recomment making a single script in your package.json that runs both build and publish, to stop broken publishes, such as "release": "preconstruct build && yarn publish:packages. If you're in a single-package repo, you could also run preconstruct build in a prepare or prepublishOnly script.

Further Guides

There are a number of tasks that become easier with preconstruct that lie slightly outside the main workflow. Check out the following guides for setting these up.

See the docs at preconstruct.tools

Thanks/Inspiration

  • microbundle was a huge inspiration for this! ❤️
  • rollup - rollup has done the really hard stuff that makes preconstruct possible!
  • bolt - lots of utils and things in this project were inspired by things in bolt
  • Kye Hohenberger for thinking of the name preconstruct
  • Too many awesome people to name at Thinkmill who have given so much great feedback to make Preconstruct better and Thinkmill for sponsoring the development of Preconstruct 💝
  • all the people who wrote all the dependencies for this project!