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

Add bundling capability #82

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

siefkenj
Copy link

Use nodejs and vite to bundle CSS for distribution.

@rbeezer
Copy link

rbeezer commented Oct 25, 2023

  • Looks like this needs more of "our" files? crc style? More color options?
  • I'm reluctant to get in the business of maintaing current copies of "other" CSS/JS, e.g. Prism.js. For example, many projects will never have a program element, and in this case, we won't even try to get the relevant support from a CDN at all. Bundled, every project will have it, need it or not. Current practice is consistent with how we only load LaTeX packages that are necessary, baed on inspection of the source.

@siefkenj
Copy link
Author

  • Looks like this needs more of "our" files? crc style? More color options?

Absolutely. This PR was a proof of concept. I was hoping someone who knows more of the pretext configuration options would create folders for each configuration.

  • I'm reluctant to get in the business of maintaing current copies of "other" CSS/JS, e.g. Prism.js. For example, many projects will never have a program element, and in this case, we won't even try to get the relevant support from a CDN at all. Bundled, every project will have it, need it or not. Current practice is consistent with how we only load LaTeX packages that are necessary, baed on inspection of the source.

This could certainly be a secondary priority, but I really don't like relying on CDNs for all of these dependencies. I had a project that used MathJax from 10 years ago. Last time I checked, it stopped working because MathJax stopped running their CDN. Textbooks should be viewable for 30+ years. I do not trust any CDN that currently exists to be around at the same URL in 30 years.

The multiple configurations issues should be easy to solve though. Since once the CSS is bundled (part of the bundling involves re-writing any CSS imports to read from ./ instead of whatever path they used before), the files can just be concatenated. This should be really easy for the CLI to do.

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

Successfully merging this pull request may close these issues.

2 participants