アンドリュー・ヴァンSlaarsは私がRiot.js +のWebPACKを始めるために使用される偉大なビデオを制作しました。
https://www.youtube.com/watch?v=UgdZbT-KPpY
彼はまたRiot.js +のWebPACKと "スターターキット" のgitリポジトリを提供します:https://github.com/avanslaars/riot-webpack-base
はどちらも非常に参考と良い出発点です。
package.jsonには、必要なものが表示されます。N.B. riotjs-loaderではなくtag-loaderの使用。私はタグローダーが私のために働くので、riotjs-loaderを試してみませんでした。
{
"name": "riot-webpack-setup",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "webpack-dev-server"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"riot": "^2.3.11"
},
"devDependencies": {
"babel-core": "^6.3.17",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.3.13",
"tag-loader": "^0.3.0",
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.0"
}
}
webpack.configファイルがで開始する非常に簡単です:
var path = require('path')
module.exports = {
entry: './src/index.js',
output: {
path: __dirname,
filename: 'bundle.js'
},
module:{
loaders:[
{
test: /\.js$/,
loader:'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015']
}
},
{
test: /\.tag$/,
loader: 'tag',
exclude: /node_modules/
}
]
}
}
あなたは[riotjs-ローダー](https://www.npmjs.com/package/riotjs-loader)を試したことがありますか?それは助けるかもしれない。 –