feature/IO-3499-React-19 -Checkpoint
This commit is contained in:
@@ -92,15 +92,17 @@
|
||||
"postinstall": "echo 'when updating react-big-calendar, remember to check to localizer in the calendar wrapper'",
|
||||
"analyze": "source-map-explorer 'build/static/js/*.js'",
|
||||
"start": "vite",
|
||||
"build": "dotenvx run --env-file=.env.development.imex --env-file=.env.development.local.overrides -- vite build",
|
||||
"build": "vite build",
|
||||
"build:dev:imex": "dotenvx run --env-file=.env.development.imex --env-file=.env.development.local.overrides -- vite build",
|
||||
"build:dev:rome": "dotenvx run --env-file=.env.development.rome --env-file=.env.development.local.overrides -- vite build",
|
||||
"build:test:imex": "dotenvx run --env-file=.env.test.imex -- vite build",
|
||||
"build:test:rome": "dotenvx run --env-file=.env.test.rome -- vite build",
|
||||
"build:production:imex": "env-cmd -f .env.production.imex vite build",
|
||||
"build:production:rome": "env-cmd -f .env.production.rome vite build",
|
||||
"start:imex": "dotenvx run --env-file=.env.development.imex --env-file=.env.development.local.overrides -- vite",
|
||||
"start:rome": "dotenvx run --env-file=.env.development.rome --env-file=.env.development.local.overrides -- vite",
|
||||
"preview:imex": "dotenvx run --env-file=.env.development.imex --env-file=.env.development.local.overrides -- vite preview",
|
||||
"preview:rome": "dotenvx run --env-file=.env.development.rome --env-file=.env.development.local.overrides -- vite preview",
|
||||
"build:test:imex": "env-cmd -f .env.test.imex -- npm run build",
|
||||
"build:test:rome": "env-cmd -f .env.test.rome -- npm run build",
|
||||
"build:production:imex": "env-cmd -f .env.production.imex -- npm run build",
|
||||
"build:production:rome": "env-cmd -f .env.production.rome -- npm run build",
|
||||
"madge": "madge --image ./madge-graph.svg --extensions js,jsx,ts,tsx --circular .",
|
||||
"eulaize": "node src/utils/eulaize.js",
|
||||
"test:unit": "vitest run",
|
||||
|
||||
@@ -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