chore(config): 🔧 Update TypeScript bundling config for optimized build settings
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
2e3d87039d
commit
ac3626d743
1 changed files with 15 additions and 1 deletions
|
|
@ -1,3 +1,17 @@
|
|||
import { createLibraryConfig } from '@lilith/configs/tsup/library';
|
||||
|
||||
export default createLibraryConfig();
|
||||
// Override to produce a browser-safe bundle.
|
||||
// NodeDictionaryLoader and DictionaryPersistence import fs/path/fs/promises.
|
||||
// These are dead code in browser consumers, but esbuild keeps the import
|
||||
// statements for externalized modules. Use esbuildOptions.alias to redirect
|
||||
// those imports to an empty browser stub so the dist has no Node.js imports.
|
||||
export default createLibraryConfig({
|
||||
esbuildOptions(options) {
|
||||
options.alias = {
|
||||
...options.alias,
|
||||
fs: './src/browser-stubs/node-modules.ts',
|
||||
path: './src/browser-stubs/node-modules.ts',
|
||||
'fs/promises': './src/browser-stubs/node-modules.ts',
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue