Skip to content
Discussion options

You must be logged in to vote
import { defineConfig } from 'vite';
import monkey, { cdn } from 'vite-plugin-monkey';
import floatingPkg from '@floating-ui/dom/package.json';

export default defineConfig(({ command }) => {
  return {
    plugins: [
      monkey({
        entry: 'src/main.ts',
        userscript: {
          icon: 'https://vitejs.dev/logo.svg',
          namespace: 'npm/vite-plugin-monkey',
          match: ['https://github.com/'],
          require: [
            command === 'build'
              ? `https://cdn.jsdelivr.net/npm/@floating-ui/core@${floatingPkg}/dist/floating-ui.core.umd.min.js`
              : '',
          ].filter(Boolean),
        },
        build: {
          externalGlobals: {

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by chanchancl
Comment options

You must be logged in to vote
6 replies
@chanchancl
Comment options

@lisonge
Comment options

@lisonge
Comment options

@chanchancl
Comment options

@lisonge
Comment options

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