npx webpackとnpm run build

こう書けば良い
package.json

{
  "scripts": {
    "build": "webpack"
  },
  "devDependencies": {
    "webpack": "^4.41.2",
    "webpack-cli": "^3.3.10"
  }
}

すると、npx webpackと同じことがnpm run buildでできる。

[vagrant@localhost front]$ npm run build

> @ build /home/vagrant/front
> webpack

Hash: e9a08af5f50ea936c82f
Version: webpack 4.41.2
Time: 95ms
Built at: 2019-11-19 23:58:48
Asset Size Chunks Chunk Names
main.js 982 bytes 0 [emitted] main
Entrypoint main = main.js
[0] ./src/index.js + 1 modules 104 bytes {0} [built]
| ./src/index.js 41 bytes [built]
| ./src/sub.js 63 bytes [built]

WARNING in configuration
The ‘mode’ option has not been set, webpack will fallback to ‘production’ for this value. Set ‘mode’ option to ‘development’ or ‘production’ to enable defaults for each environment.
You can also set it to ‘none’ to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/