0.0.3 • Published 11 years ago
componizer v0.0.3
componizer
Organize your web components code, include js,css and html template, write a components more efficiently and simply.
Componizer use a node-style require() to organize your component code, so you need use it with browserify.
Installation
npm install componizer -gDemo
Download the code and open demo/app.html you will get a simple demo.
5 Step to build your own component with componizer
1 Init
mkdir demo
cd demo
componizer initAfter init your files:
index.js
css/index.css
tmpl/index.html2 Build
componizer buildAfter build your files:
index.js # no changed
css/index.css # source code
css/index.js
tmpl/index.html # source code
tmpl/index.js3 Add your App
touch app.html
touch app.jsapp.html:
<!doctype html>
<html>
<head>
<title>demo</title>
</head>
<body>
<div id="demo"></div>
<script type="text/javascript" src="app.build.js"></script>
</body>
</html>app.js:
var demoCoponent = require('./index')
demoCoponent.render('demo')5 Browserify
browserify app.js -o app.build.jsThen open app.html you will get the demo.
You can edit index.js, index.css, index.tmpl to build your own app.
Suggest to use watch to make auto build and browserify.
Wiki
componizer will build all template file in directory tmpl to a js CMD module.
componizer will build all css file in directory css to a js CMD module.
Options you can use:
-t, --tmplExt : appoint your template file ext.