target = "_self" on nav links #1015
-
I'd like a link within my nav bar to use I believe this is happening because the link is a 3rd-party site, but I'd prefer if I had control over it. |
Beta Was this translation helpful? Give feedback.
Answered by
brc-dd
Jul 19, 2022
Replies: 2 comments 3 replies
-
See #997 |
Beta Was this translation helpful? Give feedback.
2 replies
-
You can create a import type { Plugin } from 'vite';
import { defineConfig } from 'vite';
const NavLinkPatch = (): Plugin => ({
name: 'override-target-blank',
enforce: 'pre',
transform: (code, id) => {
if (id.endsWith('VPLink.vue')) {
return code.replace('_blank', '_self');
}
},
});
export default defineConfig({
plugins: [NavLinkPatch()],
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
CodyBontecou
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can create a
vite.config.ts
inside docs and add this there for now: