-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remove usage of createRequire in core image #6488
Conversation
🦋 Changeset detectedLatest commit: 68b6209 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 |
import { ImageMetadata, InputFormat } from '../types.js'; | ||
const require = createRequire(import.meta.url); | ||
const require = createRequire(getModuleURL(import.meta.url)); | ||
const sizeOf = require('image-size'); |
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.
Would using a normal import fix the problem? If so, it might be worth investigating that. I only used require
to workaround a weird issue I had going on during dev, but it might not be required. The image integration actually imported the same package without a require
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.
Yeah I noticed that. I assumed it was necessary for a reason. I agree, I'll try that and see what happens.
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.
Switched to import
, thanks for the suggestion
!preview image-image-size |
|
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.
Changes look good but PR title and changelog seem confusing for the final changes made
Changes
Testing
Docs
N/A, bug fix