-
Notifications
You must be signed in to change notification settings - Fork 130
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
Build CJS, update package.json #701
Changes from all commits
7e52522
a104ab2
4f71fba
644f9b8
8eb7233
4228ad3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,15 @@ | |
"main": "dist/a11y-dialog.js", | ||
"module": "dist/a11y-dialog.esm.js", | ||
"types": "dist/a11y-dialog.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/a11y-dialog.esm.js", | ||
"browser": "./dist/a11y-dialog.js", | ||
"require": "./dist/a11y-dialog.cjs", | ||
"types": "./dist/a11y-dialog.d.ts" | ||
}, | ||
"./*": "./*" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like doing this: just exposing all files by default, as-typed. This is safer than having to manually type out every file one-by-one (and newer files don’t get exposed if they’re not typed out). IMO trying to be clever, and trying to anticipate how people have manually-imported specific files from |
||
}, | ||
"keywords": ["modal", "dialog", "accessibility", "a11y", "focus"], | ||
"author": "Kitty Giraudel (https://kittygiraudel.com)", | ||
"repository": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { createRequire } from 'node:module' | ||
import terser from '@rollup/plugin-terser' | ||
import { nodeResolve } from '@rollup/plugin-node-resolve' | ||
import terser from '@rollup/plugin-terser' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This got formatted by the githook IDK |
||
import typescript from '@rollup/plugin-typescript' | ||
|
||
const require = createRequire(import.meta.url) | ||
|
@@ -55,6 +55,16 @@ export default [ | |
}, | ||
], | ||
}, | ||
{ | ||
input: 'src/index.ts', | ||
plugins: plugins, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: I believe it’s generating the correct thing using the existing |
||
output: [ | ||
{ | ||
file: 'dist/a11y-dialog.cjs', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New file for Node.js that doesn’t change contents of previous files. |
||
format: 'cjs', | ||
}, | ||
], | ||
}, | ||
{ | ||
input: 'src/dom-utils.ts', | ||
plugins: plugins, | ||
|
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.
As discussed elsewhere, I guess the
"."
character is optional; I’m just used to seeing this syntax more. Probably doesn’t matter.