-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathvite.config.ts
45 lines (42 loc) · 1.24 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
41
42
43
44
45
import { defineConfig, loadEnv } from 'vite';
import laravel from 'laravel-vite-plugin';
import react from '@vitejs/plugin-react-swc'
import tailwindcss from 'tailwindcss';
import autoprefixer from 'autoprefixer';
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig(config => {
// Load env file based on `mode` in the current working directory.
// https://main.vitejs.dev/config/#using-environment-variables-in-config
const env = loadEnv(config.mode, process.cwd(), '');
return {
define: {
__APP_ENV__: JSON.stringify(env.APP_ENV),
},
plugins: [
laravel({
input: [
'resources/app/styles/index.scss',
'resources/app/index.tsx',
],
refresh: true,
// @ts-ignore
postcss: [
tailwindcss(),
autoprefixer(),
],
}),
react(),
],
css: {
preprocessorOptions: {
scss: {},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'resources/app'),
},
},
};
});