# fis-preprocessor-smarty-hmr

> fis preprocessor to smarty for start a remote hmr server

Latest version **0.1.4** (published 2017-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install fis-preprocessor-smarty-hmr
pnpm add fis-preprocessor-smarty-hmr
yarn add fis-preprocessor-smarty-hmr
bun add fis-preprocessor-smarty-hmr
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2017-07-13 |
| First published | 2017-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | clancyz |
| Maintainers | clancyz |
| Keywords | fis, preprocessor, hmr |

## Links

- npm: https://www.npmjs.com/package/fis-preprocessor-smarty-hmr
- Repository: https://github.com/clancyz/fis-preprocessor-smarty-hmr
- Homepage: https://github.com/clancyz/fis-preprocessor-smarty-hmr#readme
- Issues: https://github.com/clancyz/fis-preprocessor-smarty-hmr/issues
- npm.io page: https://npm.io/package/fis-preprocessor-smarty-hmr

## Recent versions

- 0.1.4 (latest) — 2017-07-13

## README

# fis-preprocessor-smarty-hmr

fis preprocessor to smarty for start a remote hmr server.

## Usage

### Setting fis-conf.js

1. Setting hotreload.port

```js
// Example
fis.set('hotreload.port', '8888');
```

2. Setting to smarty

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

```js
// 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`:

```bash
$ npm i cross-env -S
```

```js
"scripts": {
  "release": "cross-env HOT=true fis3 release",
}
```

By running command in cli:

```bash
$ npm run release -- [fis3 media]
```

---
_Source: https://npm.io/package/fis-preprocessor-smarty-hmr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
