Skip to content

Commit 16ccd4a

Browse files
fix: declared lodash as external resource (#55)
1 parent 675e237 commit 16ccd4a

File tree

3 files changed

+151
-3
lines changed

3 files changed

+151
-3
lines changed

esbuild.package.js

Lines changed: 9 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

@@ -11,6 +12,7 @@ const RELEASE_FOLDER_PATH = path.join(DEFAULT_RELEASE_FOLDER_PATH, `${packageDat
1112
esbuild
1213
.build({
1314
entryPoints: [
15+
path.resolve(__dirname, 'api', 'fe.js'),
1416
path.resolve(__dirname, 'forward_engineering', 'api.js'),
1517
path.resolve(__dirname, 'reverse_engineering', 'api.js'),
1618
],
@@ -21,10 +23,17 @@ esbuild
2123
outdir: RELEASE_FOLDER_PATH,
2224
minify: true,
2325
logLevel: 'info',
26+
external: ['lodash'],
2427
plugins: [
2528
clean({
2629
patterns: [DEFAULT_RELEASE_FOLDER_PATH],
2730
}),
31+
copy({
32+
assets: {
33+
from: [path.join('node_modules', 'lodash', '**', '*')],
34+
to: [path.join('node_modules', 'lodash')],
35+
},
36+
}),
2837
copyFolderFiles({
2938
fromPath: __dirname,
3039
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
@@ -71,6 +71,7 @@
7171
"@typescript-eslint/parser": "7.11.0",
7272
"esbuild": "0.20.2",
7373
"esbuild-plugin-clean": "1.0.1",
74+
"esbuild-plugin-copy": "2.1.1",
7475
"eslint": "8.57.0",
7576
"eslint-config-prettier": "9.1.0",
7677
"eslint-formatter-teamcity": "^1.0.0",
@@ -82,4 +83,4 @@
8283
"prettier": "3.2.5",
8384
"simple-git-hooks": "2.11.1"
8485
}
85-
}
86+
}

0 commit comments

Comments
 (0)