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

Compile templates at build-time #124

Open
hughesjs opened this issue Nov 15, 2022 · 2 comments
Open

Compile templates at build-time #124

hughesjs opened this issue Nov 15, 2022 · 2 comments

Comments

@hughesjs
Copy link

It seems as though compiling the templates AOT is supported and that they can be saved to and loaded from disk.

Is there any way to do this automatically at build time?

@adoconnection
Copy link
Owner

adoconnection commented Nov 19, 2022

Hi, im not sure VS can handle it by its own like it does with asp.net cshtml files.
I would go with one of these:

  • put your template compilation logic in one of classes and schedule its execution after build is complete
  • sounds like a good case for new C# code generators. See GeneratedRegex as reference

@jr01
Copy link

jr01 commented Feb 18, 2023

Another reference for implementing: MiniRazor.CodeGen

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

No branches or pull requests

3 participants