Skip to content

Add @lightningtv/source export condition#35

Merged
chiefcll merged 1 commit intolightning-tv:mainfrom
thetarnav:source-export-condition
Mar 20, 2025
Merged

Add @lightningtv/source export condition#35
chiefcll merged 1 commit intolightning-tv:mainfrom
thetarnav:source-export-condition

Conversation

@thetarnav
Copy link
Copy Markdown
Member

@thetarnav thetarnav commented Mar 13, 2025

A custom export condition allows for the source to be used by typescript/vite directly, without rebuilding, with minimal configuration, while not affecting those who do not enable it.

All thats necessary to use it:

// vite config
export default defineConfig({
  resolve: {
    conditions: ["@lightningtv/source"],
  },
});
// ts config
{
  "compilerOptions": {
    "customConditions": ["@lightningtv/source"],
  }
}

It's taken from this article and it works pretty well. I use it in solid-primitives and solid-devtools monorepos, but it should also work for linking packages with pnpm link.

I also removed the "main", "types" and "browser" fields because they are used by old cjs tools, which this package doesn't support anyway.

@chiefcll chiefcll merged commit ea46477 into lightning-tv:main Mar 20, 2025
@thetarnav thetarnav deleted the source-export-condition branch March 25, 2025 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants