Skip to content

如何使用原生的require #136

Answered by lisonge
BF-zh asked this question in Q&A
Feb 29, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote
import { defineConfig } from 'vite';
import monkey, { util } from 'vite-plugin-monkey';

export default defineConfig({
  plugins: [
    monkey({
      entry: 'src/main.ts',
      userscript: {
        require: ['your_url', util.dataUrl(';window.ajaxHooker=ajaxHooker;')],
      },
    }),
  ],
});

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@BF-zh
Comment options

@lisonge
Comment options

@lisonge
Comment options

Answer selected by BF-zh
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