GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - preconstruct/preconstruct: 🎁 Dev and build your code painlessly in monorepos

BranchesTags
Open more actions menu

Latest commit

 

History

910 Commits
910 Commits

Folders and files

NameName
Last commit message
Last commit date
.changeset
.changeset
 
 
.github
.github
 
 
.vscode
.vscode
 
 
build
build
 
 
packages
packages
 
 
site
site
 
 
types
types
 
 
.eslintignore
.eslintignore
 
 
.eslintrc.json
.eslintrc.json
 
 
.gitignore
.gitignore
 
 
.nvmrc
.nvmrc
 
 
.prettierrc
.prettierrc
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
babel.config.js
babel.config.js
 
 
knip.json
knip.json
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Preconstruct 🎁

Dev and build your code painlessly in monorepos

npm version License SDPX identifer Sponsored by Thinkmill


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 pnpm workspaces and have packages with src/index.js (or src/index.ts), you can setup Preconstruct like this.

pnpm add --save-dev @preconstruct/cli
pnpm preconstruct init

If you're in a monorepo, you should also run pnpm 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. Preconstruct 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 && pnpm 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.

  • A more detailed account of getting set up
  • Setting up a second entrypoint
  • CLI command documentation
  • Other configuration

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!

About

🎁 Dev and build your code painlessly in monorepos

preconstruct.tools

Resources

Readme
MIT license

Code of conduct

Code of conduct
Activity
Custom properties

Stars

1.2k stars

Watchers

7 watching

Forks

65 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.