Enrypase
Enrypase
SSolidJS
Created by Enrypase on 7/26/2024 in #support
defineConfig import.meta.dev
Posting down here my final configuration:
import { defineConfig } from "@solidjs/start/config";
import { resolve } from "path";
import { env } from "process";

export default defineConfig({
vite: () => {
return {
ssr: {
external: ["@prisma/client"],
},
resolve: {
alias: {
".prisma/client/index-browser":
"./node_modules/.prisma/client/index-browser.js",
$fonts: resolve(
env.NODE_ENV !== "production" ? "/fonts" : "/public/fonts"
),
},
},
server: {
port: parseInt(env.PORT || "3000"),
},
};
},
server: { preset: env.PRESET || "node-server" },
middleware: "./src/middleware.ts",
});
import { defineConfig } from "@solidjs/start/config";
import { resolve } from "path";
import { env } from "process";

export default defineConfig({
vite: () => {
return {
ssr: {
external: ["@prisma/client"],
},
resolve: {
alias: {
".prisma/client/index-browser":
"./node_modules/.prisma/client/index-browser.js",
$fonts: resolve(
env.NODE_ENV !== "production" ? "/fonts" : "/public/fonts"
),
},
},
server: {
port: parseInt(env.PORT || "3000"),
},
};
},
server: { preset: env.PRESET || "node-server" },
middleware: "./src/middleware.ts",
});
Thank you very much @mdynnl :))
31 replies
SSolidJS
Created by Enrypase on 7/26/2024 in #support
defineConfig import.meta.dev
True. hot-refreshing it shows even development. But not starting it from scratch. As you said, with the build command it shown production correctly
31 replies
SSolidJS
Created by Enrypase on 7/26/2024 in #support
defineConfig import.meta.dev
Checking this right now
31 replies
SSolidJS
Created by Enrypase on 7/26/2024 in #support
defineConfig import.meta.dev
This is very strange. Sometimes it shows up, some other times it doesn't ://
31 replies
SSolidJS
Created by Enrypase on 7/26/2024 in #support
defineConfig import.meta.dev
Ok, so, my final approach will be something like this:
import { defineConfig } from "@solidjs/start/config";
import { resolve } from "path";
import { env } from "process";

export default defineConfig({
vite: {
ssr: {
external: ["@prisma/client"],
},
resolve: {
alias: {
".prisma/client/index-browser":
"./node_modules/.prisma/client/index-browser.js",
$fonts: resolve(
env.npm_lifecycle_event === "dev" ? "/fonts" : "/public/fonts"
),
},
},
server: {
port: parseInt(env.PORT || "3000"),
},
},
server: { preset: env.PRESET || "node-server" },
middleware: "./src/middleware.ts",
});
import { defineConfig } from "@solidjs/start/config";
import { resolve } from "path";
import { env } from "process";

export default defineConfig({
vite: {
ssr: {
external: ["@prisma/client"],
},
resolve: {
alias: {
".prisma/client/index-browser":
"./node_modules/.prisma/client/index-browser.js",
$fonts: resolve(
env.npm_lifecycle_event === "dev" ? "/fonts" : "/public/fonts"
),
},
},
server: {
port: parseInt(env.PORT || "3000"),
},
},
server: { preset: env.PRESET || "node-server" },
middleware: "./src/middleware.ts",
});
But, adding a custom env variable via CMD works perfectly fine either. Thanks for the help ❤️
31 replies
SSolidJS
Created by Enrypase on 7/26/2024 in #support
defineConfig import.meta.dev
(Just checked, yarn bun and npm have the npm_lifecycle_event variable btw)
31 replies
SSolidJS
Created by Enrypase on 7/26/2024 in #support
defineConfig import.meta.dev
Perfect. Thanks! :))
31 replies
SSolidJS
Created by Enrypase on 7/26/2024 in #support
defineConfig import.meta.dev
I had already set-up my env correctly. console.logging(env) shown an interesting variable called npm_lifecycle_event that is start when npm start and dev when npm run dev. I tried it out and it seems to work. Do you think it's fine using this variable here rather than defining a custom one?
31 replies
SSolidJS
Created by Enrypase on 7/26/2024 in #support
defineConfig import.meta.dev
Gm. Thanks for your answer. I actually didn't think about setting the ENV variable via CMD. And that's a great idea for archiving the desired result! So, is this the only way for reaching my goal, in your opinion? Thank you very much! :))
31 replies
SSolidJS
Created by Enrypase on 7/15/2024 in #support
"default" is not exported by "src/entry-client.tsx"
Perfect. Thanks
9 replies
SSolidJS
Created by Enrypase on 7/15/2024 in #support
"default" is not exported by "src/entry-client.tsx"
No description
9 replies
SSolidJS
Created by Enrypase on 7/15/2024 in #support
"default" is not exported by "src/entry-client.tsx"
No description
9 replies
SSolidJS
Created by Enrypase on 6/4/2024 in #support
Cannot read properties of undefined @ router normalizePath
Regarding the issue that I had before: I used a template for simulating some API calls. When I switched to actual APIs the error doesn't happen again...
8 replies
SSolidJS
Created by Enrypase on 6/4/2024 in #support
Cannot read properties of undefined @ router normalizePath
I had multiple files named [opportunity] (in routes and routes/api) and I wanted to differentiate between them. But if there's no way for doing so it's fine : )
8 replies
SSolidJS
Created by Enrypase on 6/4/2024 in #support
Cannot read properties of undefined @ router normalizePath
No description
8 replies
SSolidJS
Created by Enrypase on 6/4/2024 in #support
Cannot read properties of undefined @ router normalizePath
No description
8 replies