Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document sideWatch usage with addon dummy app #2241

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions packages/broccoli-side-watch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ Let's assume you have a v2 addon with a package name of `grand-prix` somewhere i

Every time you change something in the source of that addon, you can rebuild it by watching the addon's build (currently using rollup). However, by default the host Ember app doesn't rebuild automatically, so you have to restart the Ember app every time this happens which is a slog.

With this library, you can add the following to your `ember-cli-build.js` to vastly improve your life as a developer:
With this library, you can add the following to your `ember-cli-build.js` to vastly improve your life as a developer.

For an Ember Application:

```js
const sideWatch = require('@embroider/broccoli-side-watch');

const app = new EmberApp(defaults, {
const app = new EmberApp(defaults, {
trees: {
app: sideWatch('app', { watching: [
'grand-prix', // this will resolve the package by name and watch all its importable code
Expand All @@ -22,3 +24,16 @@ const app = new EmberApp(defaults, {
},
});
```

Or for an Ember V1 Addon's dummy app:

```js
const app = new EmberAddon(defaults, {
trees: {
app: sideWatch('tests/dummy/app', { watching: [
'grand-prix', // this will resolve the package by name and watch all its importable code
'../grand-prix/dist', // or you point to a specific directory to be watched
] },
},
});
```