@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true })
44const node_path_1 = require ( 'node:path' )
55const node_util_1 = require ( 'node:util' )
66const node_child_process_1 = require ( 'node:child_process' )
7+ const node_fs_1 = require ( 'node:fs' )
78function shouldUseWebpack ( tsconfig ) {
89 if ( / " o u t D i r " : .* c o d e \/ e s - m o d u l e s \/ " / . test ( tsconfig ) ) {
910 return true
@@ -14,11 +15,17 @@ function compileWebpack (srcFolder, config = 'highcharts.webpack.mjs') {
1415 const configDir = 'tools/webpacks'
1516 console . log ( 'Compiling webpack for: ' , srcFolder )
1617 const execAsync = ( 0 , node_util_1 . promisify ) ( node_child_process_1 . exec )
17- return execAsync ( `npx webpack -c ${ ( 0 , node_path_1 . join ) ( configDir , config ) } --output-path ./output -- stats errors-only` , { timeout : 7000 , cwd : srcFolder } ) . then ( ( { stdout, stderr } ) => {
18+ return execAsync ( `npx webpack -c ${ ( 0 , node_path_1 . join ) ( configDir , config ) } --stats errors-only` , { timeout : 15000 , cwd : srcFolder } ) . then ( ( { stdout, stderr } ) => {
1819 if ( stderr ) {
1920 console . error ( stderr )
2021 return
2122 }
23+ // Symlink files to ./output
24+ const outputDir = ( 0 , node_path_1 . join ) ( srcFolder , '/output' )
25+ const codeDir = ( 0 , node_path_1 . join ) ( srcFolder , '/code' )
26+ if ( ( 0 , node_fs_1 . existsSync ) ( codeDir ) && ! ( 0 , node_fs_1 . existsSync ) ( outputDir ) ) {
27+ ( 0 , node_fs_1 . symlinkSync ) ( codeDir , outputDir )
28+ }
2229 console . log ( stdout )
2330 } ) . catch ( err => {
2431 throw new Error ( 'Failed running webpack' , { cause : err } )
0 commit comments