I'm trying to generate bundle.js but webpack doesn't work.
Here's the error I've got:
C:\Users\myname\Documents\lynda\ECMAScript6\Ch02\02_02\youtube2>webpack
Invalid configuration object. Webpack has been initialised using a configuration
object that does not match the API schema.
- configuration.module has an unknown property 'loaders'. These properties are
valid:
object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exp
rContextRequest?, noParse?, rules?, defaultRules?, unknownContextCritical?, unkn
ownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache
?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp?, str
ictExportPresence?, strictThisContextOnImports? }
-> Options affecting the normal modules (`NormalModuleFactory`).
- configuration.output.path: The provided value "dist" is not an absolute path!
-> The output directory as **absolute path** (required).
Here's my congif file:
module.exports = {
entry: './src/script.js',
output: {
path: 'dist',
filename: 'bundle.js'
},
module: {
loaders:[
{
test: /\js$/,
exclude: /{node_modules}/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
}
]
}
};
I've been following many tutorials about babel-loader but every time I get this type of error and won't work.