Skip to content

Commit 8ceb417

Browse files
authored
Merge pull request #84 from highcharts/bugfix/webpack-workdir
Removed output-path argument for webpack, did a symlink thing
2 parents 08996b9 + 22a29f8 commit 8ceb417

File tree

5 files changed

+243
-69
lines changed

5 files changed

+243
-69
lines changed

app/utils.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true })
44
const node_path_1 = require('node:path')
55
const node_util_1 = require('node:util')
66
const node_child_process_1 = require('node:child_process')
7+
const node_fs_1 = require('node:fs')
78
function shouldUseWebpack (tsconfig) {
89
if (/"outDir":.*code\/es-modules\/"/.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 })

app/utils.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)