Skip to content

Commit

Permalink
Remove Vercel live demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamahl19 committed Mar 1, 2024
1 parent 58cf975 commit 2af7ae8
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 16 deletions.
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

[![Main CI Status](https://github.com/Kamahl19/react-starter/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/Kamahl19/react-starter/actions?query=workflow:test+branch:main)

### 🔥 [Live Demo](https://react-starter-delta-one.vercel.app/) 🔥

## What's Included

- [React](https://react.dev/) - library to build user interfaces
Expand Down Expand Up @@ -118,13 +116,6 @@ Read more about [how to deploy to Vercel here](https://vercel.com/docs/getting-s

Now each commit pushed to the `main` branch will be deployed to production automatically. Each branch or Pull Request will be [deployed as preview](https://vercel.com/docs/deployments/preview-deployments).

### Remove Vercel Demo

This project is being deployed to Vercel for demo purposes. Follow these steps to remove it:

- Find all occurences of `process.env.VERCEL` and remove them
- Delete `vercel.json` file

### Analysing & Visualizing production JS bundle

There are 2 different tools to analyze and visualize the production JS bundle:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"i18n": "i18next",
"lint": "eslint \"./**/*.{js,cjs,ts,tsx}\" --max-warnings 0 --report-unused-disable-directives",
"prepare": "husky",
"preview": "export IS_PREVIEW=true && vite build && vite preview --port 3000",
"preview": "vite build && vite preview --port 3000",
"start": "vite",
"test": "DEBUG_PRINT_LIMIT=100000 vitest",
"test:ui": "DEBUG_PRINT_LIMIT=100000 vitest --ui",
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ startMSW()
});

async function startMSW() {
if (!import.meta.env.DEV && !__ENABLE_MSW_IN_PROD__) {
if (!import.meta.env.DEV) {
return;
}

Expand Down
2 changes: 0 additions & 2 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ interface ImportMetaEnv {
interface ImportMeta {
readonly env: ImportMetaEnv;
}

declare const __ENABLE_MSW_IN_PROD__: boolean;
3 changes: 0 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ export default defineConfig(({ mode }) => ({
template: 'sunburst',
}),
],
define: {
__ENABLE_MSW_IN_PROD__: process.env.VERCEL !== undefined || process.env.IS_PREVIEW === 'true',
},
server: {
open: true,
port: 3000,
Expand Down

0 comments on commit 2af7ae8

Please sign in to comment.