# riotjs-loader

> riotjs module loader for webpack

Latest version **4.0.0** (published 2017-01-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install riotjs-loader
pnpm add riotjs-loader
yarn add riotjs-loader
bun add riotjs-loader
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2017-01-17 |
| First published | 2015-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 100 |
| Author | Eduardo Nunes |
| Maintainers | esnunes |
| Keywords | webpack, loader, riot, riotjs, module |

## Links

- npm: https://www.npmjs.com/package/riotjs-loader
- Repository: https://github.com/esnunes/riotjs-loader
- Issues: https://github.com/esnunes/riotjs-loader/issues
- npm.io page: https://npm.io/package/riotjs-loader

## Dependencies (2)

- [loader-utils](https://npm.io/package/loader-utils.md) ^0.2.6
- [riot-compiler](https://npm.io/package/riot-compiler.md) ^3.0.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

- 4.0.0 (latest) — 2017-01-17
- 3.0.0 — 2016-03-16
- 2.0.0 — 2016-02-28
- 1.2.0 — 2015-10-12
- 1.1.3 — 2015-02-06
- 1.1.2 — 2015-01-29
- 1.1.1 — 2015-01-29
- 1.1.0 — 2015-01-29
- 1.0.1 — 2015-01-29
- 1.0.0 — 2015-01-29

## README

# riotjs module loader for webpack

## install
```bash
npm install --save-dev riot riotjs-loader babel babel-loader webpack webpack-dev-server
```

## usage

### /webpack.config.js
```javascript
var webpack = require('webpack');

module.exports = {
  entry: './app/index',
  output: {
    path: __dirname + '/public',
    filename: 'bundle.js'
  },
  plugins: [
    new webpack.ProvidePlugin({
      riot: 'riot'
    })
  ],
  module: {
    preLoaders: [
      { test: /\.tag$/, exclude: /node_modules/, loader: 'riotjs-loader', query: { type: 'none' } }
    ],
    loaders: [
      { test: /\.js$|\.tag$/, exclude: /node_modules/, loader: 'babel-loader' }
    ]
  },
  devServer: {
    contentBase: './public'
  }
};
```

### /public/index.html
```html
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>App</title>
</head>
<body>
  <app></app>
  <script src="bundle.js"></script>
</body>
</html>
```

### /app/index.js
```javascript
require('./app.tag');

riot.mount('*');
```

### /app/app.tag
```html
require('./name.tag');

<app>
  <name first="Hello" last="World"></name>
  <name first="Ola" last="Mundo"></name>
</app>
```

### /app/name.tag
```html
<name>
  <h1>{ opts.last }, { opts.first }</h1>
</name>
```

## development

```bash
./node_modules/.bin/webpack-dev-server --inline --hot
```
- open http://localhost:8080/

## LICENSE

(MIT License)

Copyright (c) 2015 Eduardo Nunes <esnunes@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

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