A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/riot/webpack-loader below:

riot/webpack-loader: Riot official webpack loader

Riot.js official webpack loader

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

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

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.

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4