webpack.config.js

webpack.config.js

module.exports = {
    entry: `./src/index.js`,

    output: {
        path: `${__dirname}`,
        filename: "main.js"
    }
}

[vagrant@localhost front]$ npm run build

> @ build /home/vagrant/front
> webpack

Hash: e4eb3bfa6713e19351bb
Version: webpack 4.41.2
Time: 92ms
Built at: 2019-11-20 00:02:50
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/

おおおおおおおおおおおおおおお
なるほど、webpackも必須やな