-
Notifications
You must be signed in to change notification settings - Fork 75
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
Origin of vfile message when using remark plugin #51
Comments
You could replace the entry point in esbuild with the file on disk and it should give you the real path in errors. const { code, frontmatter } = await bundleMDX('', {
esbuildOptions(options) {
options.entryPoints = [filePath]
return options
},
xdmOptions(options) {
options.remarkPlugins = [...(options.remarkPlugins ?? []), brokenLinks]
return options
},
}) This would then ignore the now empty in memory entry point and read your file straight from disk. Added bonus, you wont have to read the file contents in yourself either as esbuild will do it for you. |
… allow overwriting when using `write: true`
* docs: change image bundling wording to make it clear that each _bundle_ needs its own output directory, closes #52 * fix: update esbuild (and dev deps) * fix: move uvu to devDependencies * chore: fix my website address in all contributors * feat: add a test to check overriding `entryPoints` as described in #51, allow overwriting when using `write: true` * docs: document replacing the entry point * tests: swap to dirname for input path * tests: swap to contributing and improve the match * fix(ts): improve the typings
@aphecetche 4.1.0 has tests for this now and supports replacing the entry point properly now. |
@Arcath thanks a lot. Have been diverted from this for a while, will test as soon as I can. |
Actually works perfectly. Thanks ! |
I'm using a custom remarkPlugin that adds some message to a vfile under certain condition (broken link) :
I'm later on using it like so :
It's kinda working but the output is not as helpful as I'd like as I'm loosing track of the original filePath :
Is there a way to get the part before the warning (
__mdx_bundler_fake_dir__/_mdx_bundler_entry_point.mdx:0:0
be thefilePath
?Using the
cwd
bundleMDX
param I was able to change the__mdx_bundler_fake_dir__
part, but have no clue on how to deal with the other part (_mdx_bundler_entry_point.mdx:0:0
).Sorry if that's obvious.
mdx-bundler
version: 4.0.0node
version: 14.15.3npm
version: 6.14.9The text was updated successfully, but these errors were encountered: