1.0.10 • Published 6 years ago
zigmium v1.0.10
Zigmium

This project was started with an idea to create a static site generator using Svelte. Few requirement for this framework were:
- Every page is bundled into single HTML file,
- Bundle will include minified Javascript,
- Bundle will include minified CSS,
- Framework must support page template.
With this in mind project was started and results were very interesting which is the reason for publishing this Github repository. If you have some ideas on how to make this framework better, please contact me.
Basic understanding
build.ts is the main entry for bundling and creating static content.
- First of all static content is loaded in memory,
- After that file tree is created for root directories
src/pagesandsrc/templates, - From file tree, rollup bundle is created, in memory, for each page and page template,
- With this information in memory, build process is started,
- Find rollup for current page,
- Bundle page information,
- Lead
html,cssandjssrc into page, - Find all PL_VARIABLES in
jssrc, - Pull
cssclasses from src, - If page is TEMPLATE and function
modifyTemplateis available inzigmium-node.jsfile, call it, - If function
modifyPageis available inzigmium-node.jsfile, call it, - Minify CSS classes and variables in src,
- Inject CSS into JS bundle,
- Inject PL_VARIABLES into JS bundle,
- Inject JS bundle into page HTML,
- Lead
- Add bundled page to page buffer,
- Call function
finalizefromzigmium-node.jsfile.