You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-10Lines changed: 14 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,32 +7,36 @@ It has several useful features:
7
7
-[x] React as a dependency by default
8
8
-[x] MicroCMS with [ArchieML](http://archieml.org/)
9
9
-[x] Data ingest from Google Sheets
10
-
-[x] Bundling with Parcel
10
+
-[x] Bundling with [Vite](https://vitejs.dev/)
11
11
-[ ] Easy deploy to S3 bucket
12
12
13
13
## Using this template
14
14
15
15
Click the green "Use this template" button to create a new instance of the `sourdough` template. Then, clone the new instance and run `yarn install` to initialize the project.
16
16
17
-
You can use `yarn start` to start a development server and `yarn build` to build production-ready files into `dist/`.
17
+
You can use `yarn dev` to start a development server and `yarn build` to build production-ready files into `dist/`.
18
18
19
19
### Importing images
20
20
21
-
If you want to import images with variable names, you'll need to use [glob specifiers](https://parceljs.org/features/dependency-resolution/#glob-specifiers) like this:
21
+
If you want to import an image with a static name, you can simply import it:
If you want to import images with different extensions, you need not include an extension:
31
+
If you want to import images with variable names, you'll need to use a [URL constructor](https://developer.mozilla.org/en-US/docs/Web/API/URL) and [`import.meta.url`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta):
_Though we are importing all images in the above line, we will only end up sending network requests to ones that we use. So, this is not resource inefficient._
39
+
That said, you'll probably want to be importing images by using a CDN (e.g. Jetpack).
36
40
37
41
### Fetching from Google Drive
38
42
@@ -81,4 +85,4 @@ You can import a CSV file in JS like this:
81
85
import csvfile from "../data/data.csv";
82
86
```
83
87
84
-
You'll probably need something like [`d3-fetch`](https://github.com/d3/d3-fetch) to read a CSV into something usable.
88
+
We use the `@rollup/plugin-dsv`plugin (which relies on [`d3-dsv`](https://github.com/d3/d3-dsv)) to parse the CSV file into a usable array.
0 commit comments