fix: webpack error reporting + unintentional whitespace changes

This commit is contained in:
KernelDeimos 2024-09-03 14:44:51 -04:00
parent 57c2d72e21
commit 4910838ab1

View File

@ -129,7 +129,7 @@ async function build(options){
for(let i = 0; i < js_paths.length; i++){
main_array.push(path.join(__dirname, 'src', js_paths[i]));
}
await webpack({
const webpack_opts = {
...(await BaseConfig({
...options,
env: 'prod',
@ -138,12 +138,15 @@ async function build(options){
optimization: {
minimize: true,
},
}, (err, stats) => {
if(err){
console.error(err);
return;
}
if(options?.verbose)
console.log('webpack opts', webpack_opts);
await webpack(webpack_opts, (err, stats) => {
if(err){
throw err;
// console.error(err);
// return;
}
//if(options?.verbose)
console.log(stats.toString());
// write to ./dist/bundle.min.js
// fs.writeFileSync(path.join(__dirname, 'dist', 'bundle.min.js'), fs.readFileSync(path.join(__dirname, 'dist', 'main.js')));