Closed philcockfield closed 1 year ago
Includes situating the "Farcaster Client Library" which precipitated thinking through the multi-entry points for libs. https://github.com/farcasterxyz/hub-monorepo/tree/main/packages/hub-web
For example see: code/compiler.samples/web.lib-1/vite.config.mts
code/compiler.samples/web.lib-1/vite.config.mts
export default Config.vite(import.meta.url, (e) => { e.lib({ entry: { index: '/src/index.mts', Foo: '/src/logic/Foo.mts', Bar: '/src/logic/Bar.mts', }, }); e.target('web', 'node'); e.externalDependency(e.ctx.deps.map((d) => d.name)); });
Then the sample imports within: code/compiler.samples/web.lib-2/src/index.mts
code/compiler.samples/web.lib-2/src/index.mts
This was a pending task within the Package builder, that was waiting for Vite to support the multi-entry lib configuration passed to Rollup.
The Package builder produces correct {exports} and {typesVersions} entries on the package.json file based on the dist manifest.
{exports}
{typesVersions}
package.json
path: code/system/sys.net.fc/vite.config.mts
code/system/sys.net.fc/vite.config.mts
WIP: code-split this large chunk...if possible. Libs involved (suspects):
from within:
Includes situating the "Farcaster Client Library" which precipitated thinking through the multi-entry points for libs. https://github.com/farcasterxyz/hub-monorepo/tree/main/packages/hub-web
Multi Entry Lib
For example see:
code/compiler.samples/web.lib-1/vite.config.mts
Then the sample imports within:
code/compiler.samples/web.lib-2/src/index.mts
Notes
This was a pending task within the Package builder, that was waiting for Vite to support the multi-entry lib configuration passed to Rollup.
The Package builder produces correct
{exports}
and{typesVersions}
entries on thepackage.json
file based on the dist manifest.