vue-jsx-hot-loader
vue-jsx-hot-loader
Works with:
This loader will enable Hot Module Replacement
for Webpack when using Vue's JSX render functions.
Installation
npm install vue-jsx-hot-loader
Usage
// path/to/component.jsx
export default {
render(h) {
return (
<div>
<p>Hello</p>
</div>
);
},
};
// webpack.config.js
export default {
// ...
module: {
loaders: [
// Enable HMR for JSX.
{
test: /\.jsx$/,
use: [
'babel-loader',
'vue-jsx-hot-loader',
],
},
// Remember to use babel on the rest of the JS files.
{
test: /\.js$/,
use: 'babel-loader',
},
],
},
};
Gotchas
- It only works for the default exported module (which should normally be the component itself).
Development
Playground
npm run playground
Release
npx np
Dependencies
@babel/core: ^7.0.0-beta.49@babel/preset-env: ^7.0.0-beta.49@babel/preset-stage-0: ^7.0.0-beta.49@skyrpex/eslint-config-base: ^1.0.0-4@skyrpex/eslint-config-jest: ^1.0.0-4@skyrpex/eslint-config-vue: ^1.0.0-4babel-core: ^7.0.0-bridge.0babel-plugin-transform-vue-jsx: ^4.0.1eslint: ^4.19.1jest: ^23.2.0np: ^3.0.4poi: ^10.2.9vue: ^2.5.16vue-hot-reload-api: ^2.3.0