-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
50 lines (48 loc) · 1.73 KB
/
vite.config.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import eslintPlugin from 'vite-plugin-eslint'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [
vue(),
eslintPlugin(),
{
name: 'html-transform',
transformIndexHtml(html) {
// if (process.env.NODE_ENV === 'production') {
// return html.replace(
// '</head>',
// `<script>
// var _paq = window._paq = window._paq || [];
// /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
// _paq.push(['trackPageView']);
// _paq.push(['enableLinkTracking']);
// (function() {
// var u="//mtm.nendo.ai/";
// _paq.push(['setTrackerUrl', u+'matomo.php']);
// _paq.push(['setSiteId', '1']);
// var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
// g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
// })();
// </script>
// </head>`
// )
// }
return html
}
}
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
port: 5173,
hmr: {
host: 'localhost',
port: 5173,
protocol: 'ws',
},
}
})