grunt-zino
v2.0.5
Published
Assemble ZinoJS components
Downloads
2
Maintainers
Readme
grunt-zino
A Grunt task to assemble ZinoJS components. This Grunt task will walk through the provided component files and locates LINK tags with references to local CSS files as well as JS files. Those will be embedded into the resulting Zino component.
grunt-zino will also generate a JS file for every component that enables you to require()/import a component via javascript. This way it can be embedded into your existing Webpack, Rollup or other build process.
Install
npm install -D grunt-zino
Usage
// provided through npm i -D load-grunt-tasks
require('load-grunt-tasks')(grunt);
grunt.initConfig({
zino: {
dist: {
options: {
type: 'iife' // default = 'cjs'
},
files: [{
expand: true,
// where are the components defined?
cwd: './src',
// which files to use?
src: ['*.html'],
// where to generate the results to?
dest: './dist'
}]
}
}
});
grunt.registerTask('default', ['zino']);
Options
- type (String) - define the execution type of the generated JS files (supported values: 'cjs' [default], 'iife')
If the type is set to cjs
, the component will be directly exported and can be used by employing Zino.import() or similar mechanisms. If the type is set to iife
, the component code will be wrapped in an immediately invoked function expression wherein it is automatically imported.