Skip to content

Commit f4f14e5

Browse files
chore: update webpack config for output path and library type; fix TypeScript non-null assertion
1 parent be8d0fe commit f4f14e5

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

libs/khiops-hypertree/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"name": "khiops-hypertree",
33
"version": "1.1.1",
44
"main": "dist/d3-hypertree.js",
5-
"types": "dist/d/d3-hypertree.d.js",
5+
"types": "dist/js/d3-hypertree.d.ts",
66
"scripts": {
77
"build:bundle": "webpack --config webpack.config.js",
8-
"build:types": "tsc --declaration --emitDeclarationOnly --outDir dist/d/",
8+
"build:types": "tsc --declaration --emitDeclarationOnly --outDir dist/js/",
99
"build:css": "sass src/components/unitdisk/unitdisk-light.scss dist/d3-hypertree-light.css --style=compressed",
1010
"build": "yarn build:bundle && yarn build:types && yarn build:css",
1111
"start": "webpack --config webpack.config.js --watch"

libs/khiops-hypertree/webpack.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ module.exports = {
66
entry: './src/d3-hypertree.ts',
77
output: {
88
path: path.resolve(__dirname, 'dist'),
9-
filename: 'd3-hypertree.js',
10-
library: 'hyt',
9+
filename: 'js/d3-hypertree.js',
10+
library: {
11+
name: 'hyt',
12+
type: 'umd',
13+
},
14+
globalObject: 'this',
1115
},
1216
resolve: {
1317
extensions: ['.ts', '.js'],

scripts/build-dev-watch.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ cd dist/khiops-webcomponent
1616
sed -i -E 's/(--mdc-[^:]*color[^:]*)([^\w-]|:)/--mdc-v2-\1\2/g' main.js
1717

1818
cat polyfills.js styles.js main.js > khiops-webcomponents.bundle.js
19+
20+
$SHELL

src/app/khiops-visualization/components/commons/tree-hyper/tree-hyper.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ export class TreeHyperComponent
330330

331331
this.ht = new hyt.Hypertree(
332332
{
333-
parent: this.hyperTree?.nativeElement.querySelector('#hyperTree'),
333+
parent: this.hyperTree?.nativeElement.querySelector('#hyperTree')!,
334334
},
335335
this.options,
336336
);

0 commit comments

Comments
 (0)