Can I define the assets type? #253
-
I want to link a I use the default theme and Vite as a bundler, refer to the vite documentation it support to extend the assets type by using the assetsInclude option. I set this option in module.exports = {
// ...
bundlerConfig: {
viteOptions: {
assetsInclude: /\.pdf$/
}
} when I use webpack as the bundler in VuePress v1, it can use |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Just to be curious, what's the benifit to regard pdf as an asset? It surely has disadvantages such as increasing build and dev memory usage and a little more build time. You could just place it in the public folder and use an absolute link. VuePress supports images and code blocks only because they can be injected and displayed in page, but pdf can't. |
Beta Was this translation helpful? Give feedback.
-
If you do want this feature, a PR without slowing down current speed is welcomed. We may not have plans supporting this feature as we would regard this as an edge case. You do have workarounds like using absolute links or creating a markdown-it plugin for that. The built in code import plugin may help you to achieve that in markdown-it. Resources like PDFs really should not be regarded as assets. |
Beta Was this translation helpful? Give feedback.
If you do want this feature, a PR without slowing down current speed is welcomed. We may not have plans supporting this feature as we would regard this as an edge case.
You do have workarounds like using absolute links or creating a markdown-it plugin for that. The built in code import plugin may help you to achieve that in markdown-it.
Resources like PDFs really should not be regarded as assets.