25 lines
782 B
JavaScript
Executable File
25 lines
782 B
JavaScript
Executable File
import { defineConfig } from 'vite';
|
|
import laravel from 'laravel-vite-plugin';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
laravel({
|
|
input: ['resources/css/app.css', 'resources/js/app.js'],
|
|
refresh: true,
|
|
}),
|
|
],
|
|
// 💡 核心高标准配置:彻底解决所有跨域拦截
|
|
server: {
|
|
cors: true,
|
|
// 如果上面写 true 还不行,可以直接写死允许你的本地域名:
|
|
// cors: {
|
|
// origin: 'http://dd.loc',
|
|
// methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
|
|
// allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With']
|
|
// },
|
|
hmr: {
|
|
host: 'dd.loc', // 让热更新握手也走你的域名
|
|
},
|
|
},
|
|
});
|