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

Updating to use vite HMR to consolidate snippets #206

Merged
merged 4 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
39 changes: 0 additions & 39 deletions .github/workflows/consolidate-snippets.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# Consolidated snippets
public/consolidated
public/icons
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ console.log(formatDate(new Date())); // Output: '2024-12-10'
It will return nothing if they are well formatted, otherwise it will tell you what the error is.

---
To preview the snippets, you need to consolidate them, use the `snippets:consolidate` script:
To preview the snippets, start the vite server using:
```
$ npm run snippets:consolidate
$ npm run dev
```
It will update the snippets in the `/public` folder, making them available to the frontend.
It will use HMR to update the snippets in the `/public` folder, making them available to the frontend.

Expected file structure:

Expand Down
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"snippets:consolidate": "node ./utils/consolidateSnippets.js"
},
"dependencies": {
"@types/node": "^22.10.5",
"motion": "^11.15.0",
"prismjs": "^1.29.0",
"react": "^18.3.1",
Expand Down
72 changes: 0 additions & 72 deletions public/consolidated/_index.json

This file was deleted.

146 changes: 0 additions & 146 deletions public/consolidated/c.json

This file was deleted.

Loading
Loading