switch to vite

This commit is contained in:
b1ek 2023-05-07 09:51:40 +10:00
parent 46e56f5e6b
commit e9b608d296
Signed by: blek
GPG Key ID: 14546221E3595D0C
9 changed files with 2480 additions and 16 deletions

View File

@ -0,0 +1,16 @@
module.exports = {
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': 'warn',
},
}

View File

@ -9,8 +9,7 @@
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"> <div id="root"></div>
<!-- this to content --> <script type="module" src="/src/index.jsx"></script>
</div>
</body> </body>
</html> </html>

View File

@ -2,22 +2,28 @@
"name": "pairent_frontend_react", "name": "pairent_frontend_react",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"type": "module",
"dependencies": { "dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^1.4.0", "axios": "^1.4.0",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-router-dom": "^6.11.0", "react-router-dom": "^6.11.0"
"react-scripts": "5.0.1", },
"web-vitals": "^2.1.4" "devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@vitejs/plugin-react": "^4.0.0",
"eslint": "^8.40.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.1",
"vite": "^4.3.5"
}, },
"scripts": { "scripts": {
"start": "react-scripts start", "start": "vite",
"build": "react-scripts build", "build": "vite build",
"test": "react-scripts test", "test": "echo \"TODO: TESTS\" && exit -1"
"eject": "react-scripts eject"
}, },
"eslintConfig": { "eslintConfig": {
"extends": [ "extends": [

View File

@ -1,5 +1,7 @@
import axios from 'axios'; import axios from 'axios';
const { API_ROOT } = require('../constants'); import constants from '../constants';
const { API_ROOT } = constants;
export default class ApartamentService { export default class ApartamentService {
static async getAll(limit, offest) { static async getAll(limit, offest) {

View File

@ -5,4 +5,4 @@
const API_ROOT = '//127.0.0.1:8000'; const API_ROOT = '//127.0.0.1:8000';
// ДЛЯ ПРОДА ПОСТАВИТЬ ЭТО: '//pairent.vvsu.ru' // ДЛЯ ПРОДА ПОСТАВИТЬ ЭТО: '//pairent.vvsu.ru'
module.exports = Object.freeze({ API_ROOT }); export default Object.freeze({ API_ROOT });

View File

@ -0,0 +1,9 @@
import react from '@vitejs/plugin-react'
/** @type {import('vite').UserConfig} */
export default {
plugins: [
react()
],
}

File diff suppressed because it is too large Load Diff