# riot-tag-loader

> Riot official webpack loader

Latest version **2.1.0** (published 2018-06-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install riot-tag-loader
pnpm add riot-tag-loader
yarn add riot-tag-loader
bun add riot-tag-loader
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2018-06-09 |
| First published | 2017-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 58 |
| Author | Gianluca Guarini |
| Maintainers | gianlucaguarini |
| Keywords | webpack, riot, loader |

## Links

- npm: https://www.npmjs.com/package/riot-tag-loader
- Repository: https://github.com/riot/tag-loader
- Homepage: https://github.com/riot/tag-loader#readme
- Issues: https://github.com/riot/tag-loader/issues
- npm.io page: https://npm.io/package/riot-tag-loader

## Dependencies (1)

- [loader-utils](https://npm.io/package/loader-utils.md) ^1.1.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2018-06-09
- 2.0.2 — 2017-12-29
- 1.1.3 — 2017-12-25
- 2.0.1 — 2017-12-25
- 2.0.0 — 2017-12-23
- 1.1.2 — 2017-12-23
- 1.1.1 — 2017-12-23
- 1.1.0 — 2017-12-17
- 1.0.0 — 2017-01-29
- 0.0.1 — 2017-01-18

## README

# tag-loader

[![Build Status][travis-image]][travis-url]
[![Issue Count][codeclimate-image]][codeclimate-url]
[![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-url]
[![MIT License][license-image]][license-url]

Riot official webpack loader

## Installation

```shell
npm i riot-tag-loader riot-compiler -D
```

## Usage in webpack <= 3

Add the riot-tag-loader in your `webpack.config.js` file
```js
module.exports = {
  module: {
    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
```js
module.exports = {
  module: {
    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`](https://www.npmjs.com/package/riot-hot-reload)

```shell
npm 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

```js
import riot from 'riot'
import 'riot-hot-reload'

// riot will have now a new riot.reload method!!
```

### Source maps
To save time when bundling, it is possible to disable generating source maps via the `sourcemap` loader option:
```
options: {
  sourcemap: false
}
```

## Examples

Please check [this simple example](https://github.com/riot/examples/tree/gh-pages/webpack) to see how it's easy to configure webpack with riot

[travis-image]:  https://img.shields.io/travis/riot/tag-loader.svg?style=flat-square
[travis-url]:    https://travis-ci.org/riot/tag-loader
[license-image]: https://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
[license-url]:   LICENSE.txt
[npm-version-image]:   https://img.shields.io/npm/v/riot-tag-loader.svg?style=flat-square
[npm-downloads-image]: https://img.shields.io/npm/dm/riot-tag-loader.svg?style=flat-square
[npm-url]:             https://npmjs.org/package/riot-tag-loader
[codeclimate-image]: https://codeclimate.com/github/riot/tag-loader/badges/issue_count.svg
[codeclimate-url]:   https://codeclimate.com/github/riot/tag-loader

---
_Source: https://npm.io/package/riot-tag-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
