-
Notifications
You must be signed in to change notification settings - Fork 842
feat(octicons-react): add files to package.json and update npmignore #895
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
Conversation
🦋 Changeset detectedLatest commit: 09b5a77 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
colebemis
left a comment
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.
🚀
| "exports": { | ||
| "import": "dist/index.esm.js", | ||
| "require": "dist/index.umd.js" | ||
| }, |
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.
fyi I now get an error when running next build
> next build
info - Skipping validation of types
info - Linting
info - Creating an optimized production build
info - Compiled successfully
info - Collecting page data .Error [ERR_INVALID_PACKAGE_TARGET]: Invalid "exports" main target "dist/index.umd.js" defined in the package config /node_modules/@primer/octicons-react/package.json; targets must start with "./"
at new NodeError (node:internal/errors:400:5)
at invalidPackageTarget (node:internal/modules/esm/resolve:389:10)
at resolvePackageTargetString (node:internal/modules/esm/resolve:445:11)
at resolvePackageTarget (node:internal/modules/esm/resolve:522:12)
at resolvePackageTarget (node:internal/modules/esm/resolve:571:31)
at packageExportsResolve (node:internal/modules/esm/resolve:635:27)
at resolveExports (node:internal/modules/cjs/loader:538:36)
at Module._findPath (node:internal/modules/cjs/loader:607:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1025:27)
at mod._resolveFilename (/Users/gr2m/code/github/howie/app/node_modules/next/dist/build/webpack/require-hook.js:27:32) {
code: 'ERR_INVALID_PACKAGE_TARGET'
}
I think these should be
"exports": {
"import": "./dist/index.esm.js",
"require": "./dist/index.umd.js"
},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 confirmed that making the change resolves the problem
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.
there you go #905
Update the
package.jsonand.npmignorefor the@primer/octicons-reactpackage. Specifically,filesarray topackage.jsonto include only the files needed for publish.npmignorefile to match on patterns currently being included in the packageexportsfield topackage.jsonwith theimportandrequirekeys