Giter VIP home page Giter VIP logo

preconstruct's Introduction

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. 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 && 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!

preconstruct's People

Contributors

emmatown avatar renovate-bot avatar github-actions[bot] avatar renovate[bot] avatar preconstruct-release-bot avatar andarist avatar ericclemmons avatar jedwatson avatar nateradebaugh avatar noviny avatar bholloway avatar vultraz avatar evocateur avatar jesstelford avatar wkovacs64 avatar with-heart avatar madebymike avatar sibiraj-s avatar simonswiss avatar mrmartineau avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.