You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to add a custom entry point to be built on the server only.
My use case is a Prisma seeding script that will populate the database with some specific data required for the application to start. This script has some dependencies on few typescript files in the app directory.
I need this file to be compiled with it's import into a single file in order to be executed with a simple node command.
For now, I have tried to configure rollup options this way:
But I encounter the following error during remix vite:build:
[commonjs--resolver] Server-only module referenced by client
'./client.server' imported by 'app/database/init-prod-data.ts'
See https://remix.run/docs/en/main/guides/vite#splitting-up-client-and-server-code
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I would like to add a custom entry point to be built on the server only.
My use case is a Prisma seeding script that will populate the database with some specific data required for the application to start. This script has some dependencies on few typescript files in the
app
directory.I need this file to be compiled with it's import into a single file in order to be executed with a simple node command.
For now, I have tried to configure rollup options this way:
But I encounter the following error during
remix vite:build
:Is it possible to do so with Vite?
Beta Was this translation helpful? Give feedback.
All reactions