1.0.25 • Published 4 years ago

purple-lightning v1.0.25

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

Purple Lightning

Logo

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/pages and src/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, css and js src into page,
      • Find all PL_VARIABLES in js src,
      • Pull css classes from src,
      • If page is TEMPLATE and function modifyTemplate is available in pl-node.js file, call it,
      • If function modifyPage is available in pl-node.js file, 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,
    • Add bundled page to page buffer,
    • Call function finalize from pl-node.js file.

How to use

Please visit starter project.

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.19

4 years ago

1.0.2

4 years ago

1.0.18

4 years ago

1.0.1

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.20

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.0

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago