Skip to content

Commit ad81264

Browse files
HCK-9607: browser support (#39)
* chore: declared `lodash` as external resource * feat: allowed FE features in browser * chore: added `postinstall` hook
1 parent 2e7abb9 commit ad81264

20 files changed

+5409
-5275
lines changed

api/fe.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const { generateContainerScript } = require('../forward_engineering/generateContainerScript');
2+
3+
module.exports = {
4+
generateContainerScript,
5+
};

esbuild.package.js

+9
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,

0 commit comments

Comments
 (0)