Skip to content

Commit f784084

Browse files
refactor: migrate from Create React App to Vite
1 parent 82024a6 commit f784084

18 files changed

+8208
-16329
lines changed

.browserslistrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Browsers that we support
2+
3+
# For production
4+
last 2 versions
5+
not dead
6+
> 0.5%
7+
not IE 11
8+
9+
# For development
10+
last 1 chrome version
11+
last 1 firefox version
12+
last 1 safari version

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# production
1212
/build
13+
/dist
1314

1415
# misc
1516
.DS_Store

.talismanrc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ fileignoreconfig:
22
- filename: .github/workflows/secrets-scan.yml
33
ignore_detectors:
44
- filecontent
5+
- filename: src/vite-env.d.ts
6+
checksum: ffda6404f84b35b7e81317ddebcbe69cb2b1aed2727c61a58217dcbb475aaf15
7+
- filename: index.html
8+
checksum: c285279b74fe0f3b7b387049dceeb5634f4a0a3431bdcca5fdef35c360ac2101
59
- filename: package-lock.json
6-
checksum: 4245b45c24f509546e4a54e4eb59f8a3f44b32e9df1247afb61ba0bd67b459ba
10+
checksum: 62297ed5002d10755b01385713562cfb3f78e1032e38f15f8f433c0e00a4fd71
11+
- filename: src/sdk/utils.ts
12+
checksum: 00fb0674684ede99467f5d77012d92136481d54c75894768646e58703ae0fa5a
713
- filename: src/sdk/entry.ts
8-
checksum: 6cdf1d408a83b6378c6f2439d95c42dd1ad257441e0989937365428a3926a384
14+
checksum: 42de7b871970e732d243f1183b5eacf1ebe36f3dc0560afa6cc257107f696c25
915
version: "1.0"

README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
11
[![Contentstack Logo](/public/contentstack.png)](https://www.contentstack.com/)
22

3-
43
# Build a Starter Website with React.js and Contentstack
54

65
About Contentstack: Contentstack is a headless CMS with an API-first approach that puts content at the centre. It is designed to simplify the process of publication by separating code from content.
76

87
About this project: React.js is a JavaScript library for dynamic websites with rich user interfaces. This guide will help you create a starter marketing website built using the React.js framework with minimal steps.
98

10-
119
![contentstack-react-starter-app-vercel-app](/public/starter-app.png)
1210

13-
1411
## Live Demo
1512

1613
You can check the [live demo](https://contentstack-react-starter-app.vercel.app/) to get first-hand experience of the website.
1714

18-
1915
## Tutorial
2016

21-
We have created an in-depth tutorial on how you can create a React.js starter website using Contentstacks Node.js SDK and fetch its content from Contentstack.
17+
We have created an in-depth tutorial on how you can create a React.js starter website using Contentstack's Node.js SDK and fetch its content from Contentstack.
2218

2319
[Build Website using React.js and Contentstack](https://www.contentstack.com/docs/developers/sample-apps/build-a-starter-website-using-react-js-and-contentstack/)
2420

21+
## More Resources
22+
23+
- [Contentstack Documentation](https://www.contentstack.com/docs/)
24+
- [Region Support Documentation](https://www.contentstack.com/docs/developers/selecting-region-in-contentstack-starter-apps)
25+
- [React.js Documentation](https://reactjs.org/docs/getting-started.html)
26+
27+
## Build System
2528

26-
**More Resources**
29+
This project uses [Vite](https://vitejs.dev/) as a build tool for faster development and production builds. Vite offers:
2730

28-
Read Contentstack [docs](https://www.contentstack.com/docs/)
31+
- Lightning-fast cold server start
32+
- Instant hot module replacement (HMR)
33+
- True on-demand compilation
34+
- Out-of-the-box TypeScript support
2935

30-
Region support [docs](https://www.contentstack.com/docs/developers/selecting-region-in-contentstack-starter-apps)
36+
## Development Commands
3137

32-
Learn about [React.js](https://reactjs.org/docs/getting-started.html)
38+
- **Development Server**: Run `npm run dev` or `npm start` to start the development server
39+
- **Production Build**: Run `npm run build` to create an optimized production build
40+
- **Preview Production**: Run `npm run preview` to locally preview the production build

index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta name="description" content="Contentstack React Starter App" />
9+
<link rel="apple-touch-icon" href="/icon/icon-192x192.png" />
10+
11+
<link href="https://fonts.googleapis.com/css?family=Inter&amp;display=swap" rel="stylesheet" />
12+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous" />
13+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
14+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css" integrity="sha512-YWzhKL2whUzgiheMoBFwW8CKV4qpHQAEuvilg9FAn5VJUDwKZZxkJNuGM4XkWuk94WCrrwslk8yWNGmY1EduTA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
15+
<link rel="manifest" href="/manifest.json" />
16+
17+
<title>Contentstack-React-Starter-App</title>
18+
</head>
19+
20+
<body>
21+
<noscript>You need to enable JavaScript to run this app.</noscript>
22+
<div id="root"></div>
23+
<script type="module" src="/src/index.tsx"></script>
24+
</body>
25+
</html>

0 commit comments

Comments
 (0)