Здравствуйте. Начал изучать Webpack по скринкасту Ильи Кантора. Когда в файле webpack.config.js добавил настройки resolve и resolveLoader, и запустил команду webpack, появилось сообщение об ошибке, которую я никак не могу побороть:
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.resolve has an unknown property 'modulesDirectories'. These properties are valid:
object { alias?, aliasFields?, cachePredicate?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }
- configuration.resolve.extensions[0] should not be empty.
- configuration.resolveLoader has an unknown property 'moduleTemplates'. These properties are valid:
object { alias?, aliasFields?, cachePredicate?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }
- configuration.resolveLoader.extensions[0] should not be empty.
Что не так со сборкой?
webpack.config.js:
var webpack = require('webpack');
var NODE_ENV = process.env.NODE_ENV || 'development';
module.exports = {
entry: "./js/main",
output: {
filename: "js/build.js",
library: 'main'
},
watch: NODE_ENV == 'development',
watchOptions: {
aggregateTimeout: 100
},
devtool: NODE_ENV == 'development' ? 'cheap-inline-module-source-map' : null,
plugins: [
new webpack.DefinePlugin({
NODE_ENV: JSON.stringify(NODE_ENV),
LANG: JSON.stringify('ru')
})
],
resolve: {
modulesDirectories: ['node_modules'],
extensions: ['', '.js']
},
resolveLoader: {
modulesDirectories: ['node_modules'],
moduleTemplates: ['*-loader'],
extensions: ['', '.js']
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel'
}
]
}
};