jquery/test/bundler_smoke_tests/lib/run-webpack.js
Timmy Willison cb8ab6ccdb
Build: upgrade dependencies; fix bundler tests on windows
- account for newly unused parameters in the slim builds

Closes gh-5509
2024-06-15 09:11:34 -04:00

22 lines
532 B
JavaScript

import webpack from "webpack";
// See https://webpack.js.org/api/node/#webpack
export async function runWebpack() {
return new Promise( async( resolve, reject ) => {
console.log( "Running Webpack" );
const { default: config } = await import( "../webpack.config.cjs" );
webpack( config, ( err, stats ) => {
if ( err || stats.hasErrors() ) {
console.error( "Errors detected during Webpack compilation" );
reject( err );
return;
}
console.log( "Build completed: Webpack" );
resolve();
} );
} );
}