Skip to content

Commit

Permalink
Update dependencies and switch build to Vite (launchbadge#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzhang authored Nov 12, 2021
1 parent 204b084 commit 4ac5768
Show file tree
Hide file tree
Showing 17 changed files with 3,719 additions and 38,504 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/target
pkg
/node_modules
/build
/dist
*.local

Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pkg

node_modules
.DS_Store
build
dist
*.local

.vscode
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pkg

node_modules
.DS_Store
build
dist
*.local
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WORKDIR /home/rust/src
RUN apk --no-cache add curl musl-dev
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
COPY . .
RUN wasm-pack build rustpad-wasm
RUN wasm-pack build --target web rustpad-wasm

FROM node:lts-alpine as frontend
WORKDIR /usr/src/app
Expand All @@ -19,11 +19,11 @@ COPY --from=wasm /home/rust/src/rustpad-wasm/pkg rustpad-wasm/pkg
RUN npm ci
COPY . .
ARG GITHUB_SHA
ENV REACT_APP_SHA=${GITHUB_SHA}
ENV VITE_SHA=${GITHUB_SHA}
RUN npm run build

FROM scratch
COPY --from=frontend /usr/src/app/build build
COPY --from=frontend /usr/src/app/dist dist
COPY --from=backend /home/rust/src/target/release/rustpad-server .
USER 1000:1000
CMD [ "./rustpad-server" ]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ To run this application, you need to install Rust, `wasm-pack`, and Node.js.
Then, build the WebAssembly portion of the app:

```
wasm-pack build rustpad-wasm
wasm-pack build --target web rustpad-wasm
```

When that is complete, you can install dependencies for the frontend React
Expand All @@ -57,7 +57,7 @@ While the backend is running, open another shell and run the following command
to start the frontend portion.

```
npm start
npm run dev
```

This command will open a browser window to `http://localhost:3000`, with hot
Expand Down
25 changes: 0 additions & 25 deletions config-overrides.js

This file was deleted.

4 changes: 2 additions & 2 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href="%PUBLIC_URL%/favicon.svg" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Rustpad: Collaborative Code Editor</title>
<meta
Expand All @@ -18,7 +18,7 @@
/>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
Loading

0 comments on commit 4ac5768

Please sign in to comment.