Skip to content

Commit 8ea4e42

Browse files
docs(examples) fixes and clarifications
* docs(examples): added note that `yarn dev` should be run in repo root * fix(examples): removed alias in examples: alias only means to be used for local runs and we use main vite config for it, and the vite config in examples is for codesandbox * fix(examples): added asset handling of gltf and hdr for examples, both in sandbox and locally * docs(examples): referred to contributing guide rather than have separate conflicting info
1 parent 567ac1c commit 8ea4e42

File tree

4 files changed

+5
-28
lines changed

4 files changed

+5
-28
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
## Run locally
1414

15-
* Run `yarn dev` to be able to run examples
15+
* Run `yarn dev` in repo root (not in `examples` folder) to be able to run examples
1616

1717
## PR checklist
1818

examples/README.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
11
## Explore Examples
22

3-
You can explore additional examples locally. Make sure you have nodejs and yarn installed.
4-
5-
Clone repository with:
6-
7-
```bash
8-
git clone https://github.com/pmndrs/react-xr
9-
cd react-xr
10-
```
11-
12-
Install dependencies with:
13-
14-
```bash
15-
yarn
16-
```
17-
18-
Once it's done start up a local server with:
19-
20-
```bash
21-
yarn dev
22-
```
3+
You can explore additional examples locally. Instructions on how to run them are in the [CONTRIBUTING.md#run-locally](../CONTRIBUTING.md#run-locally)

examples/vite.config.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { defineConfig } from 'vite'
2-
import path from 'node:path'
32
import react from '@vitejs/plugin-react'
43
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'
54

65
// https://vitejs.dev/config/
76
export default defineConfig({
8-
plugins: [react(), vanillaExtractPlugin()],
9-
resolve: {
10-
alias: {
11-
'@react-three/xr': path.resolve(__dirname, '../src')
12-
}
13-
}
7+
assetsInclude: ['**/*.hdr', '**/*.gltf'],
8+
plugins: [react(), vanillaExtractPlugin()]
149
})

vite.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { defineConfig } from 'vite'
66

77
const config = {
88
serve: defineConfig({
9+
assetsInclude: ['**/*.hdr', '**/*.gltf'],
910
root: 'examples',
1011
plugins: [react(), ssl(), vanillaExtractPlugin()],
1112
server: { host: '0.0.0.0', https: true },

0 commit comments

Comments
 (0)