Created
January 24, 2015 01:05
-
-
Save guyromm/77d044c1fc75b117c99b to your computer and use it in GitHub Desktop.
riot + webpack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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' } | |
] | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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