Skip to content

Commit b4e9575

Browse files
authored
Hck lodash failing browser test fix (#98)
* HCK: add lodash to external dependencies list * HCK: updated bundling config to load lodash from node_modules
1 parent faedb33 commit b4e9575

File tree

3 files changed

+157
-0
lines changed

3 files changed

+157
-0
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: 148 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"@typescript-eslint/parser": "7.11.0",
6464
"esbuild": "0.20.2",
6565
"esbuild-plugin-clean": "1.0.1",
66+
"esbuild-plugin-copy": "2.1.1",
6667
"eslint": "8.57.0",
6768
"eslint-config-prettier": "9.1.0",
6869
"eslint-formatter-teamcity": "^1.0.0",

0 commit comments

Comments
 (0)