mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 19:52:10 +08:00
vite
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
NODE_ENV=production
|
||||
VUE_APP_PREVIEW=false
|
||||
VUE_APP_API_BASE_URL=
|
||||
@@ -1,3 +1,6 @@
|
||||
NODE_ENV=development
|
||||
VUE_APP_PREVIEW=true
|
||||
VUE_APP_API_BASE_URL=
|
||||
# NODE_ENV=development
|
||||
# VUE_APP_PREVIEW=true
|
||||
# VUE_APP_API_BASE_URL=
|
||||
|
||||
VITE_APP_TITLE="My App (development)"
|
||||
VITE_APP_BASE_API="/dev/api"
|
||||
6
frontend/.env.production
Normal file
6
frontend/.env.production
Normal file
@@ -0,0 +1,6 @@
|
||||
# NODE_ENV=production
|
||||
# VUE_APP_PREVIEW=false
|
||||
# VUE_APP_API_BASE_URL=
|
||||
|
||||
VITE_APP_TITLE="My App (production)"
|
||||
VITE_APP_BASE_API="/api"
|
||||
@@ -1,57 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
parserOptions: {
|
||||
parser: 'babel-eslint',
|
||||
sourceType: 'module'
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
node: true,
|
||||
es6: true,
|
||||
},
|
||||
extends: ['plugin:vue/recommended', 'eslint:recommended'],
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
"no-unused-vars":"off", //重要 var 变量为引入
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
"no-tabs":"off",
|
||||
'generator-star-spacing': 'off',
|
||||
'no-mixed-operators': 0,
|
||||
"vue/max-attributes-per-line": [2, {
|
||||
"singleline": 10,
|
||||
"multiline": {
|
||||
"max": 1,
|
||||
"allowFirstLine": false
|
||||
}
|
||||
}],
|
||||
'vue/attribute-hyphenation': 0,
|
||||
'vue/html-self-closing': 0,
|
||||
'vue/component-name-in-template-casing': 0,
|
||||
'vue/html-closing-bracket-spacing': 0,
|
||||
'vue/singleline-html-element-content-newline': 0,
|
||||
'vue/no-unused-components': 0,
|
||||
'vue/multiline-html-element-content-newline': 0,
|
||||
'vue/no-use-v-if-with-v-for': 0,
|
||||
'vue/html-closing-bracket-newline': 0,
|
||||
'vue/no-parsing-error': 0,
|
||||
'no-tabs': 0,
|
||||
'quotes': 0,
|
||||
'semi': 0,
|
||||
'no-delete-var': 2,
|
||||
'prefer-const': 0,
|
||||
'template-curly-spacing': 'off',
|
||||
//'indent': 'off',
|
||||
'indent': ["off", 2]
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: [
|
||||
'**/__tests__/*.{j,t}s?(x)',
|
||||
'**/tests/unit/**/*.spec.{j,t}s?(x)'
|
||||
],
|
||||
env: {
|
||||
jest: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
26
frontend/.gitignore
vendored
26
frontend/.gitignore
vendored
@@ -1,23 +1,5 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
@@ -1,5 +0,0 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
||||
22
frontend/index.html
Normal file
22
frontend/index.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<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, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0" />
|
||||
<title></title>
|
||||
<style>
|
||||
/* 滚动条 */
|
||||
::-webkit-scrollbar{width:8px;height:4px}
|
||||
::-webkit-scrollbar-button{width:10px;height:0}
|
||||
::-webkit-scrollbar-track{background:0 0}
|
||||
::-webkit-scrollbar-thumb{background:#E6FFEE;-webkit-transition:.3s;transition:.3s}
|
||||
::-webkit-scrollbar-thumb:hover{background-color:#07C160}
|
||||
::-webkit-scrollbar-thumb:active{background-color:#07C160}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
15888
frontend/package-lock.json
generated
15888
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,38 +1,36 @@
|
||||
{
|
||||
"name": "ee",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
"dev": "vite",
|
||||
"build-staging": "vite build --mode staging",
|
||||
"build": "vite build",
|
||||
"serve": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"ant-design-vue": "^1.7.8",
|
||||
"@ant-design/icons-vue": "^6.1.0",
|
||||
"@antv/g2": "^4.2.0",
|
||||
"ant-design-vue": "2.2.6",
|
||||
"axios": "^0.21.1",
|
||||
"core-js": "^3.6.5",
|
||||
"nprogress": "^0.2.0",
|
||||
"vite-plugin-components": "^0.13.2",
|
||||
"vue": "^3.2.33",
|
||||
"vue-router": "^4.0.14",
|
||||
"vuex": "^4.0.2",
|
||||
"socket.io-client": "^4.4.1",
|
||||
"store2": "^2.13.2",
|
||||
"vue": "^2.6.11",
|
||||
"vue-quill-editor": "^3.0.6",
|
||||
"vue-router": "^3.4.9",
|
||||
"vuex": "^3.6.0",
|
||||
"xgplayer": "^2.31.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"less": "^3.0.4",
|
||||
"less-loader": "^5.0.0",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not dead"
|
||||
]
|
||||
"@vitejs/plugin-vue": "^2.3.1",
|
||||
"@vitejs/plugin-vue-jsx": "^1.3.10",
|
||||
"@vue/compiler-sfc": "^3.2.33",
|
||||
"less": "^4.1.2",
|
||||
"less-loader": "^10.2.0",
|
||||
"postcss": "^8.4.13",
|
||||
"postcss-pxtorem": "^6.0.0",
|
||||
"vite": "^2.9.6",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-plugin-publish": "^1.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
80
frontend/vite.config.js
Normal file
80
frontend/vite.config.js
Normal file
@@ -0,0 +1,80 @@
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||
import { defineConfig } from 'vite'
|
||||
import ViteComponents, { AntDesignVueResolver } from 'vite-plugin-components'
|
||||
import viteCompression from 'vite-plugin-compression'
|
||||
|
||||
import path from 'path'
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
return {
|
||||
// 项目插件
|
||||
plugins: [
|
||||
vue(),
|
||||
vueJsx(),
|
||||
ViteComponents({
|
||||
customComponentResolvers: [AntDesignVueResolver()],
|
||||
}),
|
||||
viteCompression({
|
||||
verbose: true,
|
||||
disable: false,
|
||||
threshold: 1025,
|
||||
algorithm: 'gzip',
|
||||
ext: '.gz',
|
||||
}),
|
||||
],
|
||||
// 基础配置
|
||||
base: './',
|
||||
publicDir: 'public',
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
},
|
||||
},
|
||||
// 代理服务配置
|
||||
server: {
|
||||
host: 'https://api.wrdan.com',
|
||||
port: 9527,
|
||||
https: false,
|
||||
open: true,
|
||||
proxy: {
|
||||
'/toutiao/index': {
|
||||
target: 'http://v.juhe.cn/',
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(/\/toutiao\/index/, ''),
|
||||
},
|
||||
'/ip': {
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(/\/ip/, ''),
|
||||
},
|
||||
},
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
less: {
|
||||
modifyVars: {
|
||||
'@border-color-base': '#dce3e8',
|
||||
},
|
||||
javascriptEnabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
assetsDir: 'assets',
|
||||
assetsInlineLimit: 4096,
|
||||
cssCodeSplit: true,
|
||||
brotliSize: false,
|
||||
sourcemap: false,
|
||||
terserOptions: {
|
||||
compress: {
|
||||
// 生产环境去除console及debug
|
||||
drop_console: true,
|
||||
drop_debugger: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ee",
|
||||
"version": "3.5.2",
|
||||
"version": "3.6.0",
|
||||
"description": "A fast, desktop software development framework",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
@@ -43,6 +43,7 @@
|
||||
"devDependencies": {
|
||||
"@electron/rebuild": "^3.2.13",
|
||||
"debug": "^4.3.3",
|
||||
"ee-bin": "^1.1.0-beta.1",
|
||||
"electron": "^21.4.4",
|
||||
"electron-builder": "^23.6.0",
|
||||
"eslint": "^5.13.0",
|
||||
@@ -51,7 +52,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"dayjs": "^1.10.7",
|
||||
"ee-core": "^2.3.1",
|
||||
"ee-core": "^2.4.0-beta.1",
|
||||
"electron-updater": "^5.3.0",
|
||||
"lodash": "^4.17.21"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user