Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deno build not building tailwind styles #2729

Open
aLemonFox opened this issue Oct 23, 2024 · 4 comments
Open

Deno build not building tailwind styles #2729

aLemonFox opened this issue Oct 23, 2024 · 4 comments
Labels

Comments

@aLemonFox
Copy link

aLemonFox commented Oct 23, 2024

Hi, I have a fresh app on Digital Ocean and setup the configs for ahead of time builds. However it does not seem to work for the production version for some reason. Is it not possible to build from main.ts?

Task start deno run -A main.ts build
No pre-compiled tailwind styles found.
Did you forget to run "deno task build" prior to starting the production server?
@aLemonFox aLemonFox changed the title Deno build Deno build not building tailwind styles Oct 23, 2024
@marvinhagemeister
Copy link
Collaborator

The main.ts file is the one you use to startup your production server. It doesn't do anything with the arguments passed to it. So it makes no difference if you pass build or other strings to it.

To build your fresh application, pass build to dev.ts like so: deno run -A dev.ts build.

@aLemonFox
Copy link
Author

aLemonFox commented Oct 23, 2024

Hey, thanks for your reply. I see, but I thought dev.ts was supposed to be the root for loading dev configs (if needed). Why would the "default" start command be deno run -A main.ts and the build command be for dev.ts? It both starts the server.
edit: nevermind, the last part is incorrect. This was because I had a setup in the dev.ts file that subscribes to a remote api. This gave the impression the server started.

@aLemonFox
Copy link
Author

This is a bit off topic but then where do we put initialization of the app if it cannot be done in dev.ts with AOT builds? Since the build command in my case also fires the config setup, which locks the command as it keeps listening to incoming messages. And if I put it in main.ts only it is not fired when using the watch command deno run -A --watch=static/,routes/ dev.ts.

@marvinhagemeister
Copy link
Collaborator

To make code run in both dev and prod mode you can use a shared file that you import in both main.ts and dev.ts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants