I wanted to access modules like this
var Builder = require('Builder');
instead of
var Builder = require('./app/components/Builder');
So I generated a
webpack.config.js
file using
webpack version 1.12.13
Here is my file
module.exports =
{
entry :'./app/app.jsx',
output :{
path : __dirname,
filename: './client/bundle.js'
},
resolve :{
root : __dirname,
alias : {
},
extensions : ['.js','.jsx']
},
module :{
loaders : [
{
loader :'babel-loader',
query :{
presets:['react','es2015']
},
test :/\.jsx?$/,
exclude :/(node_modules|bower_components)/
}
]
}
}
All was fine until i updated my
webpack to version 3.5.4
and run webpack i get this error in the resolve object
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.resolve has an unknown property 'root'. These properties are valid:
object { alias?, aliasFields?, cachePredicate?, cacheWithContext?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }
What is the problem and Which change do i have to make ?