optimize deps
This commit is contained in:
16
src/pages/_document.tsx
Normal file
16
src/pages/_document.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Head, Html, Main, NextScript } from "next/document";
|
||||
import globalCss from "~/styles/globals.css?raw";
|
||||
|
||||
export default function Document() {
|
||||
return (
|
||||
<Html>
|
||||
<Head>
|
||||
<style dangerouslySetInnerHTML={{ __html: globalCss }} />
|
||||
</Head>
|
||||
<body>
|
||||
<Main />
|
||||
<NextScript />
|
||||
</body>
|
||||
</Html>
|
||||
);
|
||||
}
|
||||
1
src/vite-env.d.ts
vendored
Normal file
1
src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
||||
@@ -2,19 +2,28 @@ import { cloudflare } from "@cloudflare/vite-plugin";
|
||||
import { defineConfig } from "vite";
|
||||
import vinext from "vinext";
|
||||
|
||||
const reactOptimizeDeps = [
|
||||
"react",
|
||||
"react-dom",
|
||||
"react-dom/client",
|
||||
"react-dom/server.edge",
|
||||
"react/jsx-dev-runtime",
|
||||
"react/jsx-runtime",
|
||||
];
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vinext(), cloudflare()],
|
||||
resolve: {
|
||||
tsconfigPaths: true,
|
||||
},
|
||||
optimizeDeps: {
|
||||
include: [
|
||||
"react",
|
||||
"react-dom",
|
||||
"react-dom/client",
|
||||
"react-dom/server.edge",
|
||||
"react/jsx-dev-runtime",
|
||||
"react/jsx-runtime",
|
||||
],
|
||||
include: reactOptimizeDeps,
|
||||
},
|
||||
environments: {
|
||||
vinext_boilerplate: {
|
||||
optimizeDeps: {
|
||||
include: reactOptimizeDeps,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user