Vue Jsx Hot Loader Save

Webpack loader for Vue.js v2 components with JSX render functions

Project README

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

// 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
Open Source Agenda is not affiliated with "Vue Jsx Hot Loader" Project. README Source: skyrpex/vue-jsx-hot-loader
Stars
41
Open Issues
1
Last Commit
2 years ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating