-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.ts
40 lines (39 loc) · 1.05 KB
/
vite.config.ts
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
import { defineConfig } from 'vite'
import { resolve } from 'path'
import RubyPlugin from 'vite-plugin-ruby'
import vue from '@vitejs/plugin-vue'
import { brotliCompressSync } from 'zlib'
import gzipPlugin from 'rollup-plugin-gzip'
// see compression documentation at https://vite-ruby.netlify.app/guide/deployment.html#compressing-assets-%F0%9F%93%A6
// and https://github.com/ElMassimo/vite_ruby/discussions/101#discussioncomment-1019222
export default defineConfig({
resolve: {
alias: {
vue: 'vue/dist/vue.esm-bundler'
}
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./test/setup.js'],
alias: {
'@/': './app/javascript'
}
},
plugins: [
RubyPlugin(),
vue(),
// Create gzip copies of relevant assets
gzipPlugin(),
// Create brotli copies of relevant assets
gzipPlugin({
customCompression: (content) => brotliCompressSync(Buffer.from(content)),
fileName: '.br'
}),
{
config() {
return { define: { __VUE_PROD_DEVTOOLS__: true } }
},
},
]
})