An open API service indexing awesome lists of open source software.

https://github.com/ksky521/babel-plugin-san-hmr

Babel plugin from San component hot module replacement
https://github.com/ksky521/babel-plugin-san-hmr

babel-plugin hmr-plugin hmr-support san

Last synced: about 2 months ago
JSON representation

Babel plugin from San component hot module replacement

Awesome Lists containing this project

README

        

# babel-plugin-san-hmr

将 JavaScript 文件的 San component 添加 HMR 功能。目前支持写法如下:

```js
// 1.
import {Component} from 'san';
import './app.css';

export default class App extends Component {
constructor(opts) {
super(opts);
}
static template = '

Hello, World~

';
}
// 2.
import san from 'san';
import './app.css';

export default class App extends san.Component {
constructor(opts) {
super(opts);
}
static template = '

Hello, World~

';
}
```

## 使用方式

```js
// webpack
//...
loader: require.resolve('babel-loader'),
options: {
// ...
plugins: [
require('babel-plugin-san-hmr')
]
}
```