-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
31 lines (28 loc) · 846 Bytes
/
vite.config.js
File metadata and controls
31 lines (28 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const fs = require('fs')
const path = require('path')
const vue = require('@vitejs/plugin-vue')
// https://github.com/vitejs/vite/pull/1218
function fixFaviconBugPlugin() {
return {
rollupInputOptions: {
pluginsPostBuild: [
{
name: 'fix-favicon-bug-plugin',
async writeBundle() {
const htmlPath = path.resolve('./dist/index.html')
let html = fs.readFileSync(htmlPath).toString()
html = html.replace('href="undefined"', 'href=/assets/awesome.ico')
fs.writeFileSync(htmlPath, html)
}
}
]
}
}
}
module.exports = {
assetsDir: 'assets',
plugins: [
vue(),
// fixFaviconBugPlugin()
]
}