Skip to content

Repo demoing yarn workspaces + webpack live builds from src

License

Notifications You must be signed in to change notification settings

im-sven/monorepo-webpack-live-src-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Repo demoing yarn workspaces + webpack live builds from src

  • Yarn workspaces - pkg-one has a dependency on pkg-two, and running yarn at the top level symlinks them together, while also installing other non-symlink dependencies from npm.
  • Webpack live builds from src - webpack is configured to prefer the /src directory over the dist directory. This means any changes to pkg-two/src/index.js get picked up by webpack automatically which triggers a rebuild of pkg-one.

Demo

Build demo

Just run yarn at the top level (make sure you are using yarn 1.3 or later) and it'll run webpack and execute the output bundle to show 'Hello world'

Live updates

To see the live rebuild getting triggered:

# start webpack in watch mode:
cd packages/pkg-one && yarn dev

# in a new terminal:
echo '//' >> packages/pkg-two/src/index.js # to trigger webpack

About

Repo demoing yarn workspaces + webpack live builds from src

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published