riot/tag-loader

Name: tag-loader

Owner: Riot

Description: Riot official webpack loader

Created: 2017-01-18 19:14:53.0

Updated: 2018-05-13 17:23:12.0

Pushed: 2018-05-13 17:23:11.0

Homepage: null

Size: 70

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

tag-loader

Build Status Issue Count NPM version NPM downloads MIT License

Riot official webpack loader

Installation
i riot-tag-loader riot-compiler -D
Usage in webpack <= 3

Add the riot-tag-loader in your webpack.config.js file

le.exports = {
dule: {
loaders: [
  {
    test: /\.tag$/,
    exclude: /node_modules/,
    loader: 'riot-tag-loader',
    query: {
      hot: false, // set it to true if you are using hmr
      // add here all the other riot-compiler options riot.js.org/guide/compiler/
      // template: 'pug' for example
    }
  }
]


Usage in webpack >= 4

Add the riot-tag-loader in your webpack.config.js file

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


If you want to enable hmr you will need to install riot-hot-reload

i riot-hot-reload -D

And afterwards you should import the riot-hot-reload API (only once in your bootstrap file) in your project in order to enhance the default riot api

rt riot from 'riot'
rt 'riot-hot-reload'

iot will have now a new riot.reload method!!
Examples

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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.