Skip to content

Parcel Plugin API - Getting relative file paths #8890

Closed Answered by grimsteel
grimsteel asked this question in Q&A
Discussion options

You must be logged in to vote

I figured it out - you can use toProjectPath from @parcel/core with the projectRoot in the options object passed to the plugin:

import { toProjectPath } from "@parcel/core/lib/projectPath";
toProjectPath(options.projectRoot, asset.filePath));

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by grimsteel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant