Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/entrptaher/exp-es6-import-lerna
https://github.com/entrptaher/exp-es6-import-lerna
Last synced: about 6 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/entrptaher/exp-es6-import-lerna
- Owner: entrptaher
- Created: 2019-09-05T01:53:15.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T09:00:01.000Z (almost 2 years ago)
- Last Synced: 2024-05-28T16:16:33.206Z (6 months ago)
- Language: JavaScript
- Size: 1.66 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 23
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
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.
## Starting instructions
First install lerna and yarn, then bootstrap and symlink the packages,
```sh
lerna bootstrap
```Now let's look into individual packages.
### without-rollup
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.**
### with-parcel
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
```### with-rollup
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.**
### with-rollup-parcel
uses both above in two different commands.
```sh
# one terminal
lerna run build:watch:rollup --stream# another
lerna run build:watch:parcel --stream
```### with-webpack
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.
```sh
lerna run build:watch:webpack --stream
```