Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Use require.resolve() to check if Prism plugin files exist #236

Merged
merged 1 commit into from
Mar 8, 2021

Conversation

Turbo87
Copy link
Contributor

@Turbo87 Turbo87 commented Mar 7, 2021

The old approach implied that the filesystem layout of the node_modules folder is flat, but this does not necessarily have to be the case. For example, when using pnpm as a package manager, the prism package will be resolvable from ember-prism, but it will not be at the location that the old approach expects. This commit should fix the problem by relying on the node module resolution algorithm to determine if certain files of the Prism package exist or not.

/cc @rwwagner90

The old approach implied that the filesystem layout of the `node_modules` folder is flat, but this does not necessarily have to be the case. For example, when using pnpm as a package manager the `prism` package will be resolvable from `ember-prism`, but it will not be at the location that the old approach expects. This commit should fix the problem by relying on the node module resolution algorithm to determine if certain files of the Prism package exist or not.
@RobbieTheWagner
Copy link
Member

LGTM! Thanks for the PR.

@RobbieTheWagner RobbieTheWagner merged commit 6a3b5da into shipshapecode:master Mar 8, 2021
@Turbo87
Copy link
Contributor Author

Turbo87 commented Mar 9, 2021

thanks for merging :)

do you have any releases planned within the next days?

@RobbieTheWagner
Copy link
Member

Just released 0.9.1 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants