Skip to content

Commit 59522af

Browse files
fix: lodash bundle (#41)
1 parent c97e20f commit 59522af

3 files changed

Lines changed: 150 additions & 3 deletions

File tree

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

@@ -23,10 +24,17 @@ esbuild
2324
outdir: RELEASE_FOLDER_PATH,
2425
minify: true,
2526
logLevel: 'info',
27+
external: ['lodash'],
2628
plugins: [
2729
clean({
2830
patterns: [DEFAULT_RELEASE_FOLDER_PATH],
2931
}),
32+
copy({
33+
assets: {
34+
from: [path.join('node_modules', 'lodash', '**', '*')],
35+
to: [path.join('node_modules', 'lodash')],
36+
},
37+
}),
3038
copyFolderFiles({
3139
fromPath: __dirname,
3240
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
@@ -78,6 +78,7 @@
7878
"@typescript-eslint/parser": "7.11.0",
7979
"esbuild": "0.20.2",
8080
"esbuild-plugin-clean": "1.0.1",
81+
"esbuild-plugin-copy": "2.1.1",
8182
"eslint": "8.57.0",
8283
"eslint-config-prettier": "9.1.0",
8384
"eslint-formatter-teamcity": "^1.0.0",
@@ -88,4 +89,4 @@
8889
"prettier": "3.2.5",
8990
"simple-git-hooks": "2.11.1"
9091
}
91-
}
92+
}

0 commit comments

Comments
 (0)