2.8.9 • Published 1 month ago

@preconstruct/cli v2.8.9

Weekly downloads
7,611
License
MIT
Repository
github
Last release
1 month ago

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!
2.8.9

1 month ago

2.8.8

2 months ago

2.8.5

5 months ago

2.8.7

5 months ago

2.8.6

5 months ago

2.8.4

7 months ago

2.8.3

10 months ago

2.8.2

12 months ago

2.8.1

1 year ago

2.8.0

1 year ago

2.4.1

2 years ago

2.4.0

2 years ago

2.6.1

2 years ago

2.4.3

2 years ago

2.6.0

2 years ago

2.4.2

2 years ago

2.6.3

2 years ago

2.6.2

2 years ago

2.4.4

2 years ago

2.5.0

2 years ago

2.7.0

2 years ago

2.6.4

2 years ago

2.3.0

2 years ago

2.2.2

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.6

2 years ago

2.1.8

2 years ago

2.1.7

2 years ago

2.1.5

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

1.2.2

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.34

4 years ago

1.1.33

4 years ago

1.1.32

4 years ago

1.1.31

4 years ago

1.1.30

4 years ago

1.1.29

4 years ago

1.1.28

4 years ago

1.1.27

4 years ago

1.1.26

4 years ago

1.1.25

4 years ago

1.1.24

4 years ago

1.1.23

4 years ago

1.1.22

4 years ago

1.1.21

4 years ago

1.1.20

4 years ago

1.1.19

4 years ago

1.1.18

4 years ago

1.1.17

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.14

5 years ago

1.1.13

5 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago