I am following the tutorial exactly as given here . But I am amazed that the docs seems outdated. e.g
npx webpack src/index.js dist/bundle.js fails with
In webpack config file:
const isProd = process.env.NODE_ENV === 'production';
module.exports = {
***
mode: isProd ? 'production' : 'development'
***
};
In package.json:
***
"scripts": {
"dev": "node ./app.js",
"prod": "cross-env NODE_ENV=production npm run dev",
***
},
***
"dependencies": {
"cross-env": "^7.0.2",
***
}
***