feature/IO-3499-React-19 -Checkpoint
This commit is contained in:
@@ -11,6 +11,8 @@ import { VitePWA } from "vite-plugin-pwa";
|
||||
import InstanceRenderManager from "./src/utils/instanceRenderMgr";
|
||||
import browserslist from "browserslist";
|
||||
import { browserslistToTargets } from "lightningcss";
|
||||
import { fileURLToPath } from "url";
|
||||
import { dirname, resolve } from "path";
|
||||
|
||||
process.env.VITE_APP_GIT_SHA_DATE = new Date().toLocaleString("en-US", { timeZone: "America/Los_Angeles" });
|
||||
const commitHash = child.execSync("git rev-parse HEAD").toString().trimEnd();
|
||||
@@ -43,6 +45,9 @@ const httpsCerts = {
|
||||
cert: await fsPromises.readFile("../certs/cert.pem")
|
||||
};
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
// React Compiler is always enabled for production/test builds
|
||||
// In dev mode, it's enabled by default but can be disabled with VITE_DISABLE_COMPILER_IN_DEV=true
|
||||
@@ -63,8 +68,8 @@ export default defineConfig(({ command, mode }) => {
|
||||
resolve: {
|
||||
dedupe: ["styled-components", "react", "react-dom"],
|
||||
alias: {
|
||||
// Force all styled-components imports to resolve to the same location
|
||||
'styled-components': './node_modules/styled-components/dist/styled-components.browser.esm.js'
|
||||
// Force all styled-components imports to resolve to the same location (absolute path)
|
||||
"styled-components": resolve(__dirname, "node_modules/styled-components/dist/styled-components.browser.esm.js")
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
@@ -253,7 +258,8 @@ export default defineConfig(({ command, mode }) => {
|
||||
|
||||
// Strip console/debugger in prod to shrink bundles
|
||||
esbuild: {
|
||||
//drop: ["console", "debugger"]
|
||||
// drop: mode === "production" ? ["console", "debugger"] : [],
|
||||
legalComments: "none" // Remove license comments in production
|
||||
},
|
||||
|
||||
optimizeDeps: {
|
||||
@@ -282,7 +288,7 @@ export default defineConfig(({ command, mode }) => {
|
||||
loader: { ".jsx": "jsx", ".tsx": "tsx" }
|
||||
},
|
||||
// Force styled-components to be pre-bundled and deduplicated
|
||||
force: mode === 'development'
|
||||
force: mode === "development"
|
||||
},
|
||||
|
||||
css: {
|
||||
|
||||
Reference in New Issue
Block a user