-
-
Notifications
You must be signed in to change notification settings - Fork 168
Expand file tree
/
Copy pathvite.config.ts.ejs
More file actions
33 lines (32 loc) · 1.65 KB
/
vite.config.ts.ejs
File metadata and controls
33 lines (32 loc) · 1.65 KB
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
<% if (addOnEnabled.start) { ignoreFile() } %>import { defineConfig } from "vite";
import { devtools } from '@tanstack/devtools-vite'<% if (addOnEnabled.paraglide) { %>
import { paraglideVitePlugin } from "@inlang/paraglide-js"<% } %>
import viteReact from "@vitejs/plugin-react";
<% if (tailwind) { %>
import tailwindcss from "@tailwindcss/vite";
<% } %><%if (fileRouter) { %>
import { tanstackRouter } from "@tanstack/router-plugin/vite";<% } %><% if (addOnEnabled['module-federation']) { %>
import { federation } from "@module-federation/vite";<% } %>
import { fileURLToPath, URL } from 'node:url';<% if (addOnEnabled['module-federation']) { %>
import federationConfig from "./module-federation.config.js";<% } %><% for(const integration of integrations.filter(i => i.type === 'vite-plugin')) { %><%- integrationImportContent(integration) %>
<% } %>
// https://vitejs.dev/config/
export default defineConfig({
plugins: [devtools(), <% if (addOnEnabled.paraglide) { %>paraglideVitePlugin({
project: './project.inlang',
outdir: './src/paraglide',
strategy: ['url'],
}), <% } %><% for(const integration of integrations.filter(i => i.type === 'vite-plugin')) { %><%- integrationImportCode(integration) %>,<% } %> <% if(fileRouter) { %>tanstackRouter({
target: "react",
autoCodeSplitting: true,
}), <% } %>viteReact(<% if (addOnEnabled.compiler) { %>{
babel: {
plugins: ["babel-plugin-react-compiler"],
},
}<% } %>)<% if (tailwind) { %>, tailwindcss()<% } %><% if (addOnEnabled['module-federation']) { %>, federation(federationConfig)<% } %>],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
}
});