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 { defaultRules?, exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, strictExportPresence?, strictThisContextOnImports?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp? } -> Options affecting the normal modules (
NormalModuleFactory
). -
configuration.output.path: The provided value "dist/assets" is not an absolute path! -> The output directory as absolute path (required).
In React Tutorial course("Building with webpack") (I use of windows but course is on linux)
var webpack = require("webpack");
module.exports = {
entry: "./src/index.js",
output: {
path: "dist/assets",
filename: "bundle.js",
publicPath: "assets"
},
devServer: {
inline: true,
contentBase: './dist',
port: 3000
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules)/,
loader: ["babel-loader"],
query: {
presets: ["latest", "react", "stage-0"]
}
}
]
}
}
const { createElement } = React
const { render } = ReactDOM
const style = {
backgroundColor: 'orange',
color:'white',
fontFamily: 'verdana'
}
const title = createElement(
'h1',
{id:'title', className:'header', style: style},
'hello world'
)
render(
<h1 id='title'
className='header'
style={{backgroundColor:'orange'}}>
hello world
</h1>,
document.getElementById('react-container')
)
my cmd with command "webpack" to convert index.js to bundle.js