Skip to content

Dynamic Javascript Optimizer that enables the loading of modules + dependencies in a single response stream without depending on static build tools.

License

Notifications You must be signed in to change notification settings

peller/zazloptimizer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zazloptimizer

Node.js version of the Zazl Optimizer (http://zazl.org)

Zazl is a Dynamic Javascript Optimizer that enables the loading of AMD modules and all their dependencies in a single response stream without depending on static build tools.

Install it via npm

npm install zazloptimizer

Usage

To try it out you can load 2 sample projects stored on github

[Dojo Samples] (https://github.com/zazl/zazl-dojo-samples)

[JQuery Samples] (https://github.com/zazl/zazl-jquery-samples)

Both of these are also hosted as Heroku apps

[Dojo Samples App] (http://zazl-dojo-samples.herokuapp.com/)

[JQuery Samples App] (http://zazl-jquery-samples.herokuapp.com/)

Note: The hosting site (Heroku) puts both apps to sleep after being idle for 1hour. Don't be surprised if the first load(s) takes some time. Subsequent loads will demonstrate the full potential.

Alternatively you can download the standalone dojo samples examples, create an examples directory and unzip it into that.

To run via Connect run the following :

node lib/zazlconnect.js examples

To run on a different port :

node lib/zazlconnect.js examples 9080

To turn off javascript compression (on by default, via uglify-js) :

node lib/zazlconnect.js examples 9080 false

There are some samples available in the examples.zip that use direct injection for script loading.

http://localhost:8080/inject_amdcalendar.html

http://localhost:8080/inject_amddeclarative.html

http://localhost:8080/inject_amdmultirequire.html
    
http://localhost:8080/inject_amdlazyload.html

Project Integration

To see how to integrate the Node.js version of the optimizer into your connect based application take a look at mpdjs

About

Dynamic Javascript Optimizer that enables the loading of modules + dependencies in a single response stream without depending on static build tools.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%