This shows you don't need to add a rollup/parcel/webpack config on every package inside a monorepo. It will resolve them with some configuration on the main package.
First install lerna and yarn, then bootstrap and symlink the packages,
lerna bootstrap
Now let's look into individual packages.
is a es6 package which uses export default
syntax. This is not supported normally, but let's see.
You don't need to run this directly.
has a short build:watch
command, which executes parcel. Usually it's for the browser.
Run like below from the root folder,
lerna run build:watch --stream
has a rollup.config.js file, it uses run
, commonjs
and node-resolve
plugin for rollup. The run
is just to run it on the console.
lerna run build:watch --stream
Note: this will also run the parcel from with-parcel
since that has same start script/command. It won't run anything from the without-rollup
folder because that folder does not have this command on package.json.
uses both above in two different commands.
# one terminal
lerna run build:watch:rollup --stream
# another
lerna run build:watch:parcel --stream
is basically same as the rollup config, we provide it with required babel configuration etc and it will import as needed. For example's sake, I have put a dev server on webpack. It will create a dev index.html by itself.
lerna run build:watch:webpack --stream