项目作者: skyrpex

项目描述 :
Webpack loader for Vue.js v2 components with JSX render functions
高级语言: JavaScript
项目地址: git://github.com/skyrpex/vue-jsx-hot-loader.git
创建时间: 2016-09-22T13:01:33Z
项目社区:https://github.com/skyrpex/vue-jsx-hot-loader

开源协议:MIT License

下载


vue-jsx-hot-loader

Greenkeeper badge
TravisCI Build status

Works with:

Vue 2
Webpack

This loader will enable Hot Module Replacement for Webpack when using Vue’s JSX render functions.

Installation

npm install vue-jsx-hot-loader

Usage

  1. // path/to/component.jsx
  2. export default {
  3. render(h) {
  4. return (
  5. <div>
  6. <p>Hello</p>
  7. </div>
  8. );
  9. },
  10. };
  1. // webpack.config.js
  2. export default {
  3. // ...
  4. module: {
  5. loaders: [
  6. // Enable HMR for JSX.
  7. {
  8. test: /\.jsx$/,
  9. use: [
  10. 'babel-loader',
  11. 'vue-jsx-hot-loader',
  12. ],
  13. },
  14. // Remember to use babel on the rest of the JS files.
  15. {
  16. test: /\.js$/,
  17. use: 'babel-loader',
  18. },
  19. ],
  20. },
  21. };

Gotchas

  • It only works for the default exported module (which should normally be the component itself).

Development

Playground

  1. npm run playground

Release

  1. npx np