Skip to content

Commit 84c09ac

Browse files
authored
Merge pull request #240 from WatchItDev/migrate/webpack/to/vite
refactor: migrate from webpack to vitejs bundler
2 parents b16e20d + aa1c162 commit 84c09ac

File tree

470 files changed

+19921
-38385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

470 files changed

+19921
-38385
lines changed

.eslintrc

Lines changed: 0 additions & 99 deletions
This file was deleted.

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Include env file
2+
ifneq (,$(wildcard ./.env))
3+
include .env
4+
export
5+
endif
6+
7+
.DEFAULT_GOAL := all
8+
MAKEFLAGS += --no-print-directory
9+
10+
# When --ci option is provided, Jest will assume it is running in a CI environment.
11+
# This changes the behavior when a new snapshot is encountered. Instead of the regular behavior of storing a new snapshot automatically,
12+
# it will fail the test and require Jest to be run with --updateSnapshot.
13+
.PHONY: test ## run tests
14+
test:
15+
npx jest --ci --verbose --coverage=false --passWithNoTests
16+
17+
.PHONY: testcov ## run test coverage
18+
testcov:
19+
npx jest --ci --coverage --passWithNoTests | tee ./coverage.txt
20+
21+
.PHONY: install ## install dependencies
22+
install:
23+
npm ci
24+
25+
.PHONY: lint ## lint standard js
26+
lint:
27+
npx eslint "src/**/*.{js,jsx,ts,tsx}"

estlint.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)

public/index.html renamed to index.html

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,29 @@
55
<meta charset="utf-8" />
66
<meta name="theme-color" content="#000000" />
77
<meta name="viewport" content="width=device-width, initial-scale=1" />
8-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
8+
<link rel="manifest" href="./manifest.json" />
99

1010
<!-- Favicon -->
11-
<link rel="icon" href="%PUBLIC_URL%/favicon/favicon.ico">
12-
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon/favicon-16x16.png">
13-
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon/favicon-32x32.png">
14-
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/favicon/apple-touch-icon.png">
11+
<link rel="icon" href="./favicon/favicon.ico">
12+
<link rel="icon" type="image/png" sizes="16x16" href="./favicon/favicon-16x16.png">
13+
<link rel="icon" type="image/png" sizes="32x32" href="./favicon/favicon-32x32.png">
14+
<link rel="apple-touch-icon" sizes="180x180" href="./favicon/apple-touch-icon.png">
1515

1616
<!-- Using Google Font -->
1717
<link rel="preconnect" href="https://fonts.googleapis.com" />
1818
<link rel="preconnect" href="https://fonts.gstatic.com" />
1919
<link href="https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700;800&display=swap"
20-
rel="stylesheet" />
20+
rel="stylesheet" />
2121
<link href="https://fonts.googleapis.com/css2?family=Barlow:wght@900&display=swap" rel="stylesheet" />
2222

23-
<title>Watchit app</title>
23+
<title>Watchit App</title>
2424

2525
<meta name="description"
26-
content="" />
26+
content="" />
2727
<meta name="keywords" content="react,material,kit,application,dashboard,admin,template" />
2828
</head>
29-
3029
<body>
31-
<noscript>You need to enable JavaScript to run this app.</noscript>
32-
<div id="root"></div>
30+
<div id="root"></div>
31+
<script type="module" src="./src/index.tsx"></script>
3332
</body>
34-
3533
</html>

0 commit comments

Comments
 (0)