Skip to content

Commit 5f35358

Browse files
HCK-7326: FE crashes in browser due to lodash AMD import check (#115)
1 parent e19a0c6 commit 5f35358

File tree

3 files changed

+150
-3
lines changed

3 files changed

+150
-3
lines changed

esbuild.package.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const fs = require('fs');
22
const path = require('path');
33
const esbuild = require('esbuild');
44
const { clean } = require('esbuild-plugin-clean');
5+
const { copy } = require('esbuild-plugin-copy');
56
const { copyFolderFiles, addReleaseFlag } = require('@hackolade/hck-esbuild-plugins-pack');
67
const { EXCLUDED_EXTENSIONS, EXCLUDED_FILES, DEFAULT_RELEASE_FOLDER_PATH } = require('./buildConstants');
78

@@ -22,10 +23,17 @@ esbuild
2223
outdir: RELEASE_FOLDER_PATH,
2324
minify: true,
2425
logLevel: 'info',
26+
external: ['lodash'],
2527
plugins: [
2628
clean({
2729
patterns: [DEFAULT_RELEASE_FOLDER_PATH],
2830
}),
31+
copy({
32+
assets: {
33+
from: [path.join('node_modules', 'lodash', '**', '*')],
34+
to: [path.join('node_modules', 'lodash')],
35+
},
36+
}),
2937
copyFolderFiles({
3038
fromPath: __dirname,
3139
targetFolderPath: RELEASE_FOLDER_PATH,

package-lock.json

Lines changed: 140 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"@typescript-eslint/parser": "7.11.0",
6666
"esbuild": "0.20.2",
6767
"esbuild-plugin-clean": "1.0.1",
68+
"esbuild-plugin-copy": "2.1.1",
6869
"eslint": "8.57.0",
6970
"eslint-config-prettier": "9.1.0",
7071
"eslint-formatter-teamcity": "1.0.0",
@@ -79,4 +80,4 @@
7980
"lodash": "4.17.21",
8081
"pg": "8.12.0"
8182
}
82-
}
83+
}

0 commit comments

Comments
 (0)