Area restrita - Questionario
This commit is contained in:
+15
-44
@@ -1,58 +1,29 @@
|
||||
import devServer from "@hono/vite-dev-server"
|
||||
import path from "path"
|
||||
const __dirname = import.meta.dirname
|
||||
import react from "@vitejs/plugin-react"
|
||||
import { defineConfig } from "vite"
|
||||
// import { inspectAttr } from 'kimi-plugin-inspect-react'
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy'
|
||||
|
||||
/**
|
||||
* Plugin que adiciona X-Robots-Tag: noindex, nofollow no dev server
|
||||
* Garante que ambiente de desenvolvimento nunca seja indexado
|
||||
*/
|
||||
const devNoIndexPlugin = () => ({
|
||||
name: 'dev-noindex',
|
||||
configureServer(server: any) {
|
||||
server.middlewares.use((_req: any, res: any, next: any) => {
|
||||
res.setHeader('X-Robots-Tag', 'noindex, nofollow');
|
||||
next();
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
base: '/',
|
||||
plugins: [
|
||||
// inspectAttr(), // Desabilitado - pode causar tela em branco
|
||||
react(),
|
||||
devNoIndexPlugin(),
|
||||
viteStaticCopy({
|
||||
targets: [
|
||||
{
|
||||
src: 'public/.htaccess',
|
||||
dest: '.'
|
||||
},
|
||||
{
|
||||
src: 'public/_redirects',
|
||||
dest: '.'
|
||||
},
|
||||
{
|
||||
src: 'public/vercel.json',
|
||||
dest: '.'
|
||||
},
|
||||
{
|
||||
src: 'HTACCESS-GUIA.md',
|
||||
dest: '.'
|
||||
},
|
||||
{
|
||||
src: 'nginx.conf',
|
||||
dest: '.'
|
||||
}
|
||||
]
|
||||
})
|
||||
],
|
||||
devServer({ entry: "api/boot.ts", exclude: [/^\/(?!api\/).*$/] }),
|
||||
/* inspectAttr(), */ react()],
|
||||
server: {
|
||||
port: 3000,
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
"@contracts": path.resolve(__dirname, "./contracts"),
|
||||
"@db": path.resolve(__dirname, "./db"),
|
||||
"db": path.resolve(__dirname, "./db"),
|
||||
},
|
||||
},
|
||||
envDir: path.resolve(__dirname),
|
||||
build: {
|
||||
outDir: path.resolve(__dirname, "dist/public"),
|
||||
emptyOutDir: true,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user