Перевёл сайт с vue-cli на vite #2

This commit is contained in:
Ilia Miheev
2026-07-31 23:59:23 +03:00
parent 74f6416521
commit d8e183a0e3
10 changed files with 1362 additions and 11038 deletions
+16 -6
View File
@@ -1,24 +1,34 @@
# irandom
## Project setup
## Setup
```
npm install
```
### Compiles and hot-reloads for development
### Dev server
```
npm run serve
```
or
```
npm run dev
```
### Compiles and minifies for production
### Production build
```
npm run build
```
### Lints and fixes files
### Preview production build
```
npm run preview
```
### Lint
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
### Customization
Copy `.env.example` to `.env` and set branding / theme variables.
`npm run serve` / `npm run build` regenerates `public/config.js` automatically.
-5
View File
@@ -1,5 +0,0 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
+18
View File
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="/logo.png" />
<title>irandom</title>
<script src="/config.js"></script>
</head>
<body>
<noscript>
<strong>Для работы irandom нужен JavaScript.</strong>
</noscript>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
+7 -13
View File
@@ -1,19 +1,13 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"target": "ESNext",
"module": "ESNext",
"baseUrl": "./",
"moduleResolution": "node",
"moduleResolution": "bundler",
"paths": {
"@/*": [
"src/*"
]
"@/*": ["src/*"]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
"lib": ["ESNext", "DOM", "DOM.Iterable"]
},
"exclude": ["node_modules", "dist"]
}
+1283 -10967
View File
File diff suppressed because it is too large Load Diff
+17 -22
View File
@@ -4,33 +4,33 @@
"private": true,
"scripts": {
"generate-config": "node scripts/generate-config.js",
"predev": "node scripts/generate-config.js",
"dev": "vite",
"preserve": "node scripts/generate-config.js",
"serve": "vite",
"prebuild": "node scripts/generate-config.js",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
"build": "vite build",
"preview": "vite preview",
"lint": "eslint --ext .js,.vue src"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.2",
"core-js": "^3.8.3",
"element-plus": "^2.14.3",
"vue": "^3.2.13",
"vue": "^3.5.13",
"vue-router": "^4.6.4"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"sass": "^1.32.7",
"sass-loader": "^12.0.0"
"@vitejs/plugin-vue": "^5.2.1",
"eslint": "^8.57.1",
"eslint-plugin-vue": "^9.32.0",
"sass": "^1.83.0",
"vite": "^6.0.7"
},
"eslintConfig": {
"root": true,
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
@@ -38,14 +38,9 @@
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
}
}
-18
View File
@@ -1,18 +0,0 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>logo.png">
<title>irandom</title>
<script src="<%= BASE_URL %>config.js"></script>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
+1 -1
View File
@@ -34,7 +34,7 @@ const routes = [
]
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
history: createWebHistory(import.meta.env.BASE_URL),
routes
})
+18
View File
@@ -0,0 +1,18 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
},
server: {
port: 8080
}
})
-4
View File
@@ -1,4 +0,0 @@
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true
})