Skip to content

ryansolid/component-register-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solid Components Loader

This loader is intended to wrap your Component Register custom elements for HMR automatically.

Installation

# NPM
$ npm install --save-dev component-register-loader

# Yarn
$ yarn add --dev component-register-loader

Usage

You need to add this library to your webpack config. Note that you should carefuly set webpack's rule condition so that component-register-loader is only used for actual component files.

module.exports = {
  module: {
    rules: [
      {
        test: /\.js/,
        use: ['component-register-loader'],
        // If and only if all your components are in `path/to/components` directory
        include: path.resolve(__dirname, 'path/to/components')
      }
    ]
  }
}

And you have to export each component as default export.

export default register('my-component')(MyComponent);

About

A Webpack Loader to add Hot Module Replacement for Component Register

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors