Skip to content

Commit

Permalink
feat: npm watch synced with live-refresh demo (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar authored Nov 11, 2022
1 parent bdf5802 commit 276baa7
Show file tree
Hide file tree
Showing 4 changed files with 393 additions and 43 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ dist

# Fractal
demo
## Empty file touched after auto-rebuild to trigger server live-refresh */
fractal.server.refresh.css

# IDE
.vscode
Expand Down
32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,32 +129,42 @@ buildStylesheets(
Code configuration happens in repos that use these styles.
### Previewing the Styles
### Previewing Built Demo
1. [Install][npm-install] the dependencies:
```bash
npm ci
```
2. Build stylesheets and demo:
1. Build stylesheets and build static demo:
```bash
npm run build
```
3. Run the pattern library:
2. Run the static demo:
```bash
npm start
npx serve demo
```
<sup>Live reloads on demo file change, but **not** source file change.</sup>
4. Open the web interface.
The build command will output the URL (and may even open it for you).
[npm-install]: https://docs.npmjs.com/cli/v8/commands/npm-ci
### Previewing During Development
Run each of these commands in its own terminal.
1. Build stylesheets and re-build on change:
```bash
npm run build:watch
```
2. Run the auto-refresh demo:
```bash
npm start
```
<sup>Source file change causes **two** demo refreshes. The **second** reload will show changes.</sup>
### Source Files
Expand Down
Loading

0 comments on commit 276baa7

Please sign in to comment.