riot.jsをいじってみようとwebpackを設定してた時に出たエラー
実行した環境
- webpack2.2.1
- riotjs-loader4.0.0
webpack.configは公式を参考に
riotjs-loader公式
設定したらwebpack実行するとエラーが出た。
出たエラー
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration[0].module has an unknown property 'preLoaders'. These properties are valid:
object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, loaders?, noParse?, rules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp? }
Options affecting the normal modules (`NormalModuleFactory`).
- configuration[0].resolve.extensions[0] should not be empty.
エラー1個目
preLoadersってなんぞ?って言ってるっぽいのでとりあえず検索
Webpack config has an unknown property 'preLoaders'
エラー出る前
preLoaders: [
{
test: /\.tag$/,
exclude: /node_modules/,
loader: 'riotjs-loader'
}
],
参考に(というかそのまんま)修正
rules: [
{
test: /\.tag$/,
exclude: /node_modules/,
enforce: "pre",
loader: 'riotjs-loader',
query: {
type: 'babel'
}
}
],
エラー2個目
configuration.resolve.extensions[0] should not be empty.
これを元に検索
After upgrade to Webpack beta 23 I can no longer use blank extesnions
エラー前
resolve: {
extensions: ['', '.js', '.tag']
},
修正
resolve: {
extensions: ['*', '.js', '.tag']
},
これで無事にwebpackが実行できました!