Skip to content

riot/webpack-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8e03782 · Apr 26, 2024

History

85 Commits
Aug 18, 2023
Oct 6, 2023
Oct 6, 2023
Aug 18, 2023
Aug 18, 2023
Aug 18, 2023
Jul 11, 2021
Aug 18, 2023
Aug 18, 2023
Jan 18, 2017
Apr 26, 2024
Oct 6, 2023
Oct 6, 2023
Aug 18, 2023

Repository files navigation

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 afterward webpack will be able to automatically reload your Riot.js components in runtime.

Examples

Please check the following exapmles to see how it's easy to configure webpack with riot: