funkwhale/front/vite.config.js

42 wiersze
938 B
JavaScript
Czysty Zwykły widok Historia

2022-02-21 14:07:07 +00:00
// vite.config.js
import { defineConfig } from 'vite'
import { createVuePlugin as vue } from "vite-plugin-vue2";
import path from 'path'
2022-02-21 14:07:07 +00:00
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
2022-02-22 11:34:54 +00:00
{
name: 'fix-fomantic-ui-css',
transform (src, id) {
if (id.includes('fomantic-ui-css') && id.endsWith('.min.js')) {
return `import jQuery from 'jquery';${src}`
}
}
},
{
name: 'fix-django-channels',
transform (src, id) {
if (id.includes('django-channels')) {
return `var parcelRequire;${src}`
}
}
}
],
2022-03-08 09:37:37 +00:00
server: {
port: process.env.VUE_PORT || '8080',
hmr: {
2022-04-02 17:38:14 +00:00
port: process.env.FUNKWHALE_PROTOCOL === 'https' ? 443 : 8000,
protocol: process.env.FUNKWHALE_PROTOCOL === 'https' ? 'wss' : 'ws',
2022-03-08 09:37:37 +00:00
}
2022-04-02 17:38:14 +00:00
},
2022-02-21 14:07:07 +00:00
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
2022-04-02 17:38:14 +00:00
},
2022-02-21 14:07:07 +00:00
})