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
- Host: GitHub
- URL: https://github.com/ksky521/babel-plugin-san-hmr
- Owner: ksky521
- Created: 2019-05-16T03:14:51.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-27T07:35:21.000Z (over 5 years ago)
- Last Synced: 2025-02-18T19:11:26.497Z (2 months ago)
- Topics: babel-plugin, hmr-plugin, hmr-support, san
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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')
]
}
```