eight04 / rollup-plugin-iife

Convert ES modules into IIFEs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add `prefix` option

enkot opened this issue · comments

It would be very useful to add prefix option.

What is expected?

//...
iife({
    prefix: '_my_'
})

Output file:

var _my_componentA = (function () { //...
commented

It seems reasonable to prefix those names which are generated automatically to avoid conflict. However, I'm not sure if we should also prefix names defined in names option.

Yes, agree with you. Can you check pull request #4?