Skip to content

Commit 1d80110

Browse files
fix(vite): Remove Vite production use warnings (#8266)
1 parent 7562e4d commit 1d80110

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

packages/remix-dev/vite/plugin.ts

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -276,16 +276,6 @@ const getRouteModuleExports = async (
276276
return exportNames;
277277
};
278278

279-
const showUnstableWarning = () => {
280-
console.warn(
281-
colors.yellow(
282-
colors.bold(
283-
"\n ⚠️ Remix support for Vite is unstable and\n not yet recommended for production\n"
284-
)
285-
)
286-
);
287-
};
288-
289279
const getViteMajorVersion = (): number => {
290280
let vitePkg = require("vite/package.json");
291281
return parseInt(vitePkg.version.split(".")[0]!);
@@ -723,14 +713,6 @@ export const remixVitePlugin: RemixVitePlugin = (options = {}) => {
723713
buildStart() {
724714
invariant(viteConfig);
725715

726-
if (
727-
viteCommand === "build" &&
728-
// Only show warning on initial client build
729-
!viteConfig.build.ssr
730-
) {
731-
showUnstableWarning();
732-
}
733-
734716
if (
735717
viteCommand === "build" &&
736718
viteConfig.mode === "production" &&
@@ -739,26 +721,24 @@ export const remixVitePlugin: RemixVitePlugin = (options = {}) => {
739721
) {
740722
viteConfig.logger.warn(
741723
colors.yellow(
742-
colors.bold(" ⚠️ Source maps are enabled in production\n") +
724+
"\n" +
725+
colors.bold(" ⚠️ Source maps are enabled in production\n") +
743726
[
744727
"This makes your server code publicly",
745728
"visible in the browser. This is highly",
746729
"discouraged! If you insist, ensure that",
747730
"you are using environment variables for",
748731
"secrets and not hard-coding them in",
749-
"your source code.\n",
732+
"your source code.",
750733
]
751734
.map((line) => " " + line)
752-
.join("\n")
735+
.join("\n") +
736+
"\n"
753737
)
754738
);
755739
}
756740
},
757741
configureServer(viteDevServer) {
758-
viteDevServer.httpServer?.on("listening", () => {
759-
setTimeout(showUnstableWarning, 50);
760-
});
761-
762742
setDevServerHooks({
763743
// Give the request handler access to the critical CSS in dev to avoid a
764744
// flash of unstyled content since Vite injects CSS file contents via JS

0 commit comments

Comments
 (0)