Skip to content

Commit f446d74

Browse files
Merge pull request #206 from Mathys-Gasnier/main
Updating to use vite HMR to consolidate snippets
2 parents 52e7c9c + 145a139 commit f446d74

36 files changed

+56
-3709
lines changed

.github/workflows/consolidate-snippets.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ dist-ssr
2323
*.njsproj
2424
*.sln
2525
*.sw?
26+
27+
# Consolidated snippets
28+
public/consolidated
29+
public/icons

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ console.log(formatDate(new Date())); // Output: '2024-12-10'
141141
It will return nothing if they are well formatted, otherwise it will tell you what the error is.
142142
143143
---
144-
To preview the snippets, you need to consolidate them, use the `snippets:consolidate` script:
144+
To preview the snippets, start the vite server using:
145145
```
146-
$ npm run snippets:consolidate
146+
$ npm run dev
147147
```
148-
It will update the snippets in the `/public` folder, making them available to the frontend.
148+
It will use HMR to update the snippets in the `/public` folder, making them available to the frontend.
149149
150150
Expected file structure:
151151

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"snippets:consolidate": "node ./utils/consolidateSnippets.js"
1717
},
1818
"dependencies": {
19+
"@types/node": "^22.10.5",
1920
"motion": "^11.15.0",
2021
"prismjs": "^1.29.0",
2122
"react": "^18.3.1",

public/consolidated/_index.json

Lines changed: 0 additions & 72 deletions
This file was deleted.

public/consolidated/c.json

Lines changed: 0 additions & 146 deletions
This file was deleted.

0 commit comments

Comments
 (0)