-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
51 lines (47 loc) · 1.36 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
46
47
48
49
50
51
import { defineConfig } 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';
//import { ViteEjsPlugin } from 'vite-plugin-ejs';
import { compilerOptions } from './tsconfig.json';
const __dirname = path.dirname(new URL(import.meta.url).pathname);
const alias = Object.entries(compilerOptions.paths).reduce((acc, [key, [dist, src]]) => {
return {
...acc,
// [key]: path.resolve(__dirname, '../', src),
[key]: path.resolve(src),
};
}, {});
// https://vitejs.dev/config/
/** @type {import('vite').UserConfig} */
export default defineConfig({
plugins: [
laravel({
input: [
'resources/app/styles/index.scss',
'resources/app/index.tsx',
],
refresh: true,
// @ts-ignore
postcss: [
tailwindcss(),
autoprefixer(),
],
}),
react({ jsxImportSource: "@emotion/react" }),
],
css: {
preprocessorOptions: {
scss: {},
},
},
resolve: {
alias: {
...alias,
// '@': path.resolve(__dirname, 'resources/app'),
'@': path.resolve('resources/app'),
},
},
});