riot-webpack

0.0.1 • Public • Published

Webpack

This is a simple example of using webpack with riot. It uses webpack loader riotjs-loader.

Run locally

Download or clone this repo.

Install packages.

$ npm install -g

And then run the server using webpack-dev-server or any possible way you know

$ npm start -g

ES6 using Babel

You can add ES6 support as shown in riotjs-loader's example. All you have to do is edit webpack.config.js and change webpack's modules to

module: {
    preLoaders: [
      { test: /\.tag$/, exclude: /node_modules/, loader: 'riotjs-loader', query: { type: 'none' } }
    ],
    loaders: [
      { test: /\.js$|\.tag$/, exclude: /node_modules/, loader: 'babel-loader', query: { presets: ['es2015'] } }
    ]
}

As explained in riot-examples/es6, you will lose riot's shorthand syntax. So this:

getMessage() { ... }

becomes (using ES6):

this.getMessage = () => { ... }

Readme

Keywords

Package Sidebar

Install

npm i riot-webpack

Weekly Downloads

2

Version

0.0.1

License

MIT

Last publish

Collaborators

  • anyjser