Skip to content
Riot official webpack loader
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src updated: bundled files Jun 10, 2019
test fixed: typo in the unit test Apr 19, 2019
.codeclimate.yml fixed: typo Jan 18, 2017
.eslintignore added: experimental sourcemap support Dec 17, 2017
.eslintrc added: initial setup Feb 24, 2019
.gitignore updated: removed generated files Jun 10, 2019
.travis.yml updated: async tests strategy Jun 16, 2018
LICENSE Initial commit Jan 18, 2017
README.md fixed: path to the riot compiler future url Apr 19, 2019
package-lock.json 4.0.1 Jun 10, 2019
package.json 4.0.1 Jun 10, 2019
rollup.config.js updated: v4.0.0 Apr 19, 2019

README.md

Riot.js webpack-loader

Build Status Issue Count NPM version NPM downloads MIT License

Riot.js official webpack loader

Important

If you are using Riot.js < 4.0.0 please check the v3 branch

Installation

npm i @riotjs/webpack-loader @riotjs/compiler -D

Usage

Add the @riotjs/webpack-loader in your webpack.config.js file

module.exports = {
  module: {
    rules: [
      {
        test: /\.riot$/,
        exclude: /node_modules/,
        use: [{
          loader: '@riotjs/webpack-loader',
          options: {
            hot: false, // set it to true if you are using hmr
            // add here all the other @riotjs/compiler options riot.js.org/compiler
            // template: 'pug' for example
          }
        }]
      }
    ]
  }
}

If you want to enable hmr via hot option you will need to install also @riotjs/hot-reload

npm i @riotjs/hot-reload -D

And afterwards webpack will be able to automatically reload your Riot.js components in runtime.

Examples

Please check this simple example to see how it's easy to configure webpack with riot

You can’t perform that action at this time.