getkey / rollup-plugin-obfuscator

The most powerful rollup plugin for javascript-obfuscator.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Suggestion] A way to add a header to the generated bundle

GeekCornerGH opened this issue · comments

I appologie if this is the wrong place to make feature requests, I couldn't find any other fitting place.

I'm required to run the plugin in enforce: "post" mode, because I'm using some import.meta.env and it would break otherwise. Sadly, I can't add a header to the generated bundle, as I can't manage to get a custom-written vite plugin to execute after obfuscator has done its work.

So what about adding an option which would add a header to the js bundle?

Regards

Salut, could you give me an example of what you would put in that header? I'm sure there are other plugins to add headers, that you would be able to use also with post, but defined in your config after this plugin.

But I think since you are using import.meta.env, most likely the solution you are actually looking for is this one: #11 (comment) 🙂

I'd add something like copyright text or so like

/*
Copyright someName 2024, all right reserved
/*
console.log("Hello world"); // Placeholder for actual code

I tried changing the order of the plugins, yet this doesn't works