0.0.1 • Published 7 years ago

riot-webpack v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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 = () => { ... }