-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial typescript support as well as bundling for ES & CJS #245
base: master
Are you sure you want to change the base?
Add initial typescript support as well as bundling for ES & CJS #245
Conversation
// initCSSPolyfill returns true iff the host browser supports SDA | ||
if (initCSSPolyfill()) { | ||
return; | ||
} | ||
|
||
if ([...document.styleSheets].filter((s) => s.href !== null).length) { | ||
if ([ ...document.styleSheets ].filter((s) => s.href !== null).length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may of had the pretty: true
flag turned on momentarily that led to this autoformatting, happy to remove it.
@@ -0,0 +1,29 @@ | |||
{ | |||
"compilerOptions": { | |||
"target": "ES2020", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these might not be necessary, I was working through which ones were needed or not but starting from a point where at least it was all working for us.
@@ -25,4 +27,5 @@ export default defineConfig({ | |||
}, | |||
} | |||
}, | |||
plugins: [dts()], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates the index.d.ts
file for the exported type information. Without this many folks importing through a bundler with typescript would require not-insignificant amounts of changes and no typing information. It's possible to do it without another package, but it helped simplify the output quite a bit.
This is a slight modification to support typescript type exporting as well as publishing ES & CJS versions along with the published build. It doesn't do auto publishing or tagging mentioned in #57, but might help with figuring a few things out in that process.