Closed scattter closed 1 year ago
@emersonbottero Hello, I found this issue during testing on the latest version v2.0.14. Is this modification not included in the latest version yet?
@emersonbottero The find
property of alias
may be a RegExp
, in this case, it cannot be converted to an object and will display an error: Type 'RegExp' cannot be used as an index type
.
For example, when we need to replace a component of the default theme:
alias: [
{
find: /^.*\/VPHero\.vue$/,
replacement: fileURLToPath(
new URL('../theme/components/Hero.vue', import.meta.url),
),
},
]
@emersonbottero The
find
property ofalias
may be aRegExp
, in this case, it cannot be converted to an object and will display an error:Type 'RegExp' cannot be used as an index type
.For example, when we need to replace a component of the default theme:
alias: [ { find: /^.*\/VPHero\.vue$/, replacement: fileURLToPath( new URL('../theme/components/Hero.vue', import.meta.url), ), }, ]
I create a PR to fix this issue: https://github.com/emersonbottero/vitepress-plugin-mermaid/pull/58
now version doesn't support array type in alias config just object type, this commit can support user use array type. An example in here: https://github.com/emersonbottero/vitepress-plugin-mermaid/issues/56