Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable automatic comments #24

Closed
gius opened this issue Dec 5, 2022 · 4 comments
Closed

Disable automatic comments #24

gius opened this issue Dec 5, 2022 · 4 comments

Comments

@gius
Copy link

gius commented Dec 5, 2022

Can I disable the /*! ... */ wrapper? I would like to use this plugin to inject a #!/usr/bin/env node shebang to the code.

@chengpeiquan
Copy link
Owner

Of course, the content is highly customizable. Comment symbols will only be added when they are missing.
Refer to this example: vite.config.ts

@gius
Copy link
Author

gius commented Dec 7, 2022

Ah, good point - I actually have to add any comment to skip the automatic wrapping.

I mean, this does not work:

  plugins: [
    banner(
      `#!/usr/bin/env node`
    ),
  ],

whereas this works:

  plugins: [
    banner(
      `#!/usr/bin/env node\n/* My app */`
    ),
  ],

@chengpeiquan
Copy link
Owner

Got it! I will add an option to support this requirement.

@chengpeiquan chengpeiquan reopened this Dec 7, 2022
@chengpeiquan
Copy link
Owner

Please upgrade to 0.7.0 and set the verify option to false:

// vite.config.ts
export default defineConfig({
  plugins: [
    banner({
      content: `#!/usr/bin/env node`,
      verify: false,
    }),
  ],
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants