Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@guyromm
Created January 24, 2015 01:05
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guyromm/77d044c1fc75b117c99b to your computer and use it in GitHub Desktop.
Save guyromm/77d044c1fc75b117c99b to your computer and use it in GitHub Desktop.
riot + webpack
//sample entry file
require('./node_modules/riot/dist/riot.js');
require('./timer.tag')
require('./todo.tag')
require('./todo.css')
riot.mount('todo', {
title: 'I want to behave!',
items: [
{ title: 'Avoid excessive coffeine', done: true },
{ title: 'Be less provocative' },
{ title: 'Be nice to people' }
]
});
var loaderUtils = require("loader-utils");
var path = require("path");
var riot_compile = require('riot/compiler')
module.exports = function(source) {
var js =riot_compile(source, { compact:true})
return js;
}
module.exports = {
entry: './entry.js',
output: {
path: 'bundle/',
filename: 'bundle.js',
publicPath: 'bundle/',
},
resolve: {
riot: require.resolve('./node_modules/riot/dist/riot.js')
},
module: {
loaders: [
{ test: /\.(tag)$/, loader: "tag" },
{ test: /\.(woff|ttf|svg|eot|jpg)$/, loader: "file" },
{ test: /\.css$/, loader: "style!css" },
{ test: /\.coffee$/, loader: "coffee-loader" },
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment