npm.io
0.1.4 • Published 9 years ago

fis-preprocessor-smarty-hmr

Licence
MIT
Version
0.1.4
Deps
0
Vulns
0
Weekly
0

fis-preprocessor-smarty-hmr

fis preprocessor to smarty for start a remote hmr server.

Usage

Setting fis-conf.js

  1. Setting hotreload.port
// Example
fis.set('hotreload.port', '8888');
  1. Setting to smarty

By setting config to fis preprocessor. May contain multiple pages.

// Example
fis.match('*.tpl', {
    preprocessor: fis.plugin('smarty-hmr', {
        config: [{
            pagePath: 'page/index.tpl',
            bundleName: 'bundle.js',
            blockName: 'top-head-extend',
            exclude: 'a.js',
            // exclude: ['a.js', 'b.js'],            
            valid: true
        }]
    }),
});
Config item options
options description type required default
pagePath path to page String YES -
bundleName bundle file name String YES -
blockName which smarty block to inject bundle file String OPTIONAL top-head-extend
exclude exclude js name String or Array OPTIONAL -
valid if this rules is valid Boolean OPTIONAL true
Starting via fis release

You need to set env HOT=true and start fis release:

Intergration in npm script:

$ npm i cross-env -S
"scripts": {
  "release": "cross-env HOT=true fis3 release",
}

By running command in cli:

$ npm run release -- [fis3 media]

Keywords