using webpack5
webpack already does not need a config file:
npx webpack --mode=production --entry ./index.js --output-path dist/ --output-filename main.js
manual adding a config file, export can be single or array, webpack.config.js:
import path from "path"; export default [ { mode: "production", entry: "./index.js", output: { path: path.resolve("./dist/"), filename: "bundle.js", }, }, { mode: "production", entry: "./index1.js", output: { filename: "bundle1.js", }, }, ];
浙公网安备 33010602011771号