Repository navigation
feat(v2): add support to import assets using relative link in markdown syntax - #3096
Conversation
|
Deploy preview for docusaurus-2 ready! Built with commit 831c08e |
|
I converted pr to use remark plugin since it will be more uniform. |
There was a problem hiding this comment.
LGTM
Let regular file-loader of webpack kick in for regular files, not using the inline syntax
In particular, we want files processed by this feature to end up in /build/assets/files/file-hash.ext
It is important because we want in the future to enable users to cache the /build/assets folder aggressively (#3156)
|
|
||
| node.type = 'jsx'; | ||
| node.value = `<a target="_blank" ${ | ||
| assetPath ? `href={require('!file-loader!${assetPath}').default}` : '' |
There was a problem hiding this comment.
We only need this "file-loader" because of the conflict with ideal-image, it is less likely to happen for other files.
When using this syntax, the options must be passed as querystring.
I think we should remove the !file-loader! so that default webpack file loader that we set kick in, so that correct options are applied automatically.
See also what I did here for images: #3180
There was a problem hiding this comment.
I added file-loader for unknow files.
There was a problem hiding this comment.
Probably user can add !file-loader! in front of path themself :)
|
LGTM :) |
…n syntax (meta#3096) * add a rehyper plugin * fix yarn.lok * add target * convert to remark * add docs * remove unused package * remove file-loader * add test for file-loader * fix test
Motivation
Help in importing assets.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
By adding test
Here working example -> https://deploy-preview-3096--docusaurus-2.netlify.app/build/docs/next/markdown-features#common-assets