Skip to content

Commit

Permalink
feat: 头部插入代码
Browse files Browse the repository at this point in the history
  • Loading branch information
orilights committed Dec 16, 2023
1 parent f49ef9a commit f5f27cd
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"prettier.enable": false,
"editor.tabSize":2,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"editor.formatOnSave": false
}
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>原神官网新闻检索</title>
<%= injectHead %>
</head>
<body>
<div id="app"></div>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"typescript": "^5.1.3",
"unplugin-auto-import": "^0.16.4",
"vite": "^4.3.9",
"vite-plugin-simple-html": "^0.1.1",
"vue-tsc": "^1.8.1"
},
"simple-git-hooks": {
Expand Down
121 changes: 121 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'node:path'
import { defineConfig } from 'vite'
import simpleHtmlPlugin from 'vite-plugin-simple-html'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'

Expand All @@ -17,5 +18,12 @@ export default defineConfig({
dts: true,
vueTemplate: true,
}),
simpleHtmlPlugin({
inject: {
data: {
injectHead: process.env.INJECT_HEAD || '',
},
},
}),
],
})

0 comments on commit f5f27cd

Please sign in to comment.