Use rolldownOptions.transform.define

This commit is contained in:
Michael Telatynski
2026-06-04 12:18:22 +01:00
parent 82b5397c7d
commit 9d9991d838
4 changed files with 28 additions and 20 deletions
+7 -5
View File
@@ -38,6 +38,13 @@ export default defineConfig({
react: "window.React", react: "window.React",
}, },
}, },
transform: {
define: {
// Use production mode for the build as it is tested against production builds of Element Web,
// this is required for React JSX versions to be compatible.
"process.env.NODE_ENV": JSON.stringify("production"),
},
},
}, },
}, },
plugins: [ plugins: [
@@ -48,9 +55,4 @@ export default defineConfig({
include: ["events"], include: ["events"],
}), }),
], ],
define: {
// Use production mode for the build as it is tested against production builds of Element Web,
// this is required for React JSX versions to be compatible.
process: { env: { NODE_ENV: "production" } },
},
}); });
+7 -5
View File
@@ -36,6 +36,13 @@ export default defineConfig({
react: "window.React", react: "window.React",
}, },
}, },
transform: {
define: {
// Use production mode for the build as it is tested against production builds of Element Web,
// this is required for React JSX versions to be compatible.
"process.env.NODE_ENV": JSON.stringify("production"),
},
},
}, },
minify: false, minify: false,
}, },
@@ -45,9 +52,4 @@ export default defineConfig({
include: ["events"], include: ["events"],
}), }),
], ],
define: {
// Use production mode for the build as it is tested against production builds of Element Web,
// this is required for React JSX versions to be compatible.
process: { env: { NODE_ENV: "production" } },
},
}); });
@@ -37,6 +37,13 @@ export default defineConfig({
react: "window.React", react: "window.React",
}, },
}, },
transform: {
define: {
// Use production mode for the build as it is tested against production builds of Element Web,
// this is required for React JSX versions to be compatible.
"process.env.NODE_ENV": JSON.stringify("production"),
},
},
}, },
}, },
plugins: [ plugins: [
@@ -46,9 +53,4 @@ export default defineConfig({
include: ["events"], include: ["events"],
}), }),
], ],
define: {
// Use production mode for the build as it is tested against production builds of Element Web,
// this is required for React JSX versions to be compatible.
process: { env: { NODE_ENV: "production" } },
},
}); });
@@ -38,6 +38,13 @@ export default defineConfig({
react: "window.React", react: "window.React",
}, },
}, },
transform: {
define: {
// Use production mode for the build as it is tested against production builds of Element Web,
// this is required for React JSX versions to be compatible.
"process.env.NODE_ENV": JSON.stringify("production"),
},
},
}, },
}, },
plugins: [ plugins: [
@@ -48,9 +55,4 @@ export default defineConfig({
include: ["events"], include: ["events"],
}), }),
], ],
define: {
// Use production mode for the build as it is tested against production builds of Element Web,
// this is required for React JSX versions to be compatible.
process: { env: { NODE_ENV: "production" } },
},
}); });