lilo-views-packager

Package lilo (https://bitbucket.org/yangibaev/lilo/wiki/Home) templates and view factories files.

npm install lilo-views-packager
15 downloads in the last week
60 downloads in the last month

Lilo views packager

Views packager is a cli tool that search and pack lilo templates, view factories files and styles.

All files supports special -id- placeholder that will be replaced with appropriate view name.

//style.css in view1 dir

.-id-{
  //some styles
}


//style.css in view2 dir

.-id-{
  //some styles
}

Output styles.css will contain

 //styles.css


.view1{
  //some styles
}

.view2{
  //some styles
}

Packager works with following dir structure:

myViews(-r --rootDir arg)

  |

  |---view1

  |         |---template.html

  |         |---factory.js

  |         |---style.css

  |

  |---view2

           |---template.html

           |---factory.js

           |---style.css

Outputs:

  |---outDir(-o --outDir arg)

           |---templates.html

           |---viewFactories.js

           |---styles.css

//templates.js

lilo.templates["view1"] = "content of view1->template.html";
lilo.templates["view2"] = "content of view2->template.html";
//viewFactories.js

lilo.viewFactories["view1"] = (function(){
  //Function from view1->factory.js
});
lilo.viewFactories["view2"] = (function(){
  //Function from view2->factory.js
});
//styles.css

//Combined content from style files
npm loves you