When using a relative path for stats.context
as in the documention
// webpack.config.js
module.exports = {
// ...webpack config
stats: {
context: './src'
}
};
the build command is failing:
$ webpack --mode production --json artifacts/webpack-stats
[webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration.stats.context: The provided value "./src" is not an absolute path!
-> Context directory for request shortening.
error Command failed with exit code 2.