The problem of webpack Multi-entry Packaging js Code

entry: {

pageA: "./src/pages/pageA.js",
pageB: "./src/pages/pageB.js",

},
above is my multi-entry configuration;

for example, if you have an a.js file,
when you package pageA, the final packaged js code is console.log ("A"), and
when you package pageB, the final packaged js code is console.log ("B"),

how can it be implemented?

problem to be solved: different js codes are packaged according to the different entry pages currently packaged, and the corresponding page (a.js) needs to determine which entry file is currently packaged.

Apr.07,2021

htmlwebpackplugin

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eab73c-205d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eab73c-205d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?