Replies: 2 comments 2 replies
-
|
You can also use a plugin with I didn't try but something like this should work: export default function MyAliasPlugin(context, options) {
return {
name: 'my-alias-plugin',
configureWebpack() {
return {
resolve: {
alias: {
"@myAlias", "/my/aliased/path"
},
},
};
},
};
} |
Beta Was this translation helpful? Give feedback.
-
|
Regarding the comment @slorber made about writing an alias plugin, I can confirm that works nicely. Specifically, I:
One cool thing I discovered is that aliases can be composed together (perhaps it says that in large letters in the webback docs; i dont know, I just copy-pasted slorber's code snippet). So I can start with a basic alias and build on top: alias: {
"@dc": "/docs-common",
"@dcr": "@dc/reference",
"@dcrc":"@dcr/components"
}Aliases are very useful - I've got quite a few of them now. I use them throughout both the JS and MDX files. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi to everybody.
In my doc project I have some .md files with references of a custom component.
The references is:
import TcfPurposes from '../../src/components/TcfPurposes.tsx'This works. The problem is that now I've translated my files to a new language so I have those .md files also under the i18n/languagecode/.... path.
If I build the documentation, an error occurs about the custom component path.
in this docusaurus doc page I've read about alias but I'm not able to find any information about how set them inside the project.
I've already checked the doc about the docusaurus.config.js.
How can I set aliases to use in my project? maybe an additional plugin should be added?
I already have
Thanks
Beta Was this translation helpful? Give feedback.
All reactions