提交 bac4ffe1 编写于 作者: 米司特包's avatar 米司特包

refactor: refactor with vite

上级 abb9bf13
> 1%
last 2 versions
not dead
.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
\ No newline at end of file
{
"recommendations": ["johnsoncodehk.volar"]
}
# wails-template-vue
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run dev
```
### Compiles and minifies for production
```
npm run build
```
### Open the web server to preview the packaged resources
```
npm run serve
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
此差异已折叠。
{
"name": "{{.ProjectName}}",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vue-cli-service serve",
"build": "vue-cli-service build",
"serve": "serve dist"
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"author": "{{.AuthorName}}",
"dependencies": {
"vue": "^3.0.0",
"vue-i18n": "^9.1.7",
"vue-router": "^4.0.0-0"
"vue": "^3.2.16",
"vue-i18n": "^9.1.9",
"vue-router": "^4.0.12"
},
"devDependencies": {
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"serve": "^12.0.0"
}
"@vitejs/plugin-vue": "^1.9.3",
"sass": "^1.43.4",
"vite": "^2.6.4"
},
"author": "{{.AuthorName}}"
}
frontend/public/favicon.ico

20.5 KB | W: | H:

frontend/public/favicon.ico

4.2 KB | W: | H:

frontend/public/favicon.ico
frontend/public/favicon.ico
frontend/public/favicon.ico
frontend/public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
</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>
</body>
</html>
\ No newline at end of file
import { createI18n } from 'vue-i18n'
import zhHans from './messages/zh-Hans.json'
import en from './messages/en.json'
import fr from './messages/fr.json'
const i18n = createI18n({
locale: "en",
fallbackLocale: 'en',
messages: {
"zh-Hans": require('./messages/zh-Hans.json'),
"en": require('./messages/en.json'),
"fr": require('./messages/fr.json')
"zh-Hans": zhHans,
"en": en,
"fr": fr
}
})
......
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import i18n from './i18n'
import router from '@/router'
import i18n from '@/i18n'
// Register global common components
// 注册全局通用组件
......
import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '../views/Home.vue'
import Home from '@/views/Home.vue'
const routes = [
{
......
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
},
},
build: {
rollupOptions: {
output: {
entryFileNames: `assets/[name].js`,
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/[name].[ext]`,
}
},
}
})
module.exports = {
// The build file does not use the hash file name
// 构建文件不使用hash文件名
filenameHashing: false,
// Package the css into a separate file
// 将css打包到单独的文件
css: {
extract: "true"
}
}
\ No newline at end of file
......@@ -3,7 +3,6 @@
"outputfilename": "{{.BinaryName}}",
"assetdir": "frontend/dist",
"frontend:install": "npm install",
"frontend:dev":"",
"frontend:build": "npm run build",
"author": {
"name": "{{.AuthorName}}",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册