lisonge / vite-plugin-monkey

A vite plugin server and build your.user.js for userscript engine like Tampermonkey, Violentmonkey, Greasemonkey, ScriptCat
MIT License
1.24k stars 65 forks source link

Is there any way to set comments in the `/* */` comments code above `// ==UserScript==` ? #115

Closed jawayang closed 7 months ago

jawayang commented 7 months ago

Is there any way to set comments in the /* */ comments code above // ==UserScript== ? For example:

/* globals jQuery, $ */
/* eslint-disable */
// ==UserScript==

thank you.

lisonge commented 7 months ago
export default defineConfig({
  plugins: [
    monkey({
      entry: 'src/main.ts',
      format: {
        generate(uOptions) {
          return [
            `/* globals jQuery, $ */`,
            `/* eslint-disable */`,
            uOptions.userscript,
          ].join('\n');
        },
      },
    }),
  ],
});