Skip to content

target = "_self" on nav links #1015

Closed Locked Answered by brc-dd
CodyBontecou asked this question in Q&A
Discussion options

You must be logged in to vote

You can create a vite.config.ts inside docs and add this there for now:

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()],
});

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@brc-dd
Comment options

@xfq
Comment options

Comment options

You must be logged in to vote
1 reply
@CodyBontecou
Comment options

Answer selected by CodyBontecou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants