-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add option to keep license for certain tree-shaken dependencies #1092
Comments
Hi @timmb, Thanks for the issue! |
Hi @mjeanroy Please see here: https://github.com/timmb/mwe-rollup-plugin-license-missing-glsl-licenses Run Code from I don't anticipate this plugin working with glslify but I currently have no option to make it include the licence for See the README in the demo repo for more detail. |
Hi @timmb, I'm a bit torn with your proposal: in the example you shared above, Furthermore, I'm not sure if including build dependency in the dependency file output is the right thing to do. Btw, a bit out of scope, but #380 is not the cause of your issue, as |
Hi @mjeanroy, Thank you for looking into this. I should clarify. It's not the code from If you build, open As code from |
Thanks @timmb for all the details, I definitely agree with your conclusion:
Let me dig a bit deeper, I would like to check if this issue can be fixed without adding a new option. |
I came here looking for the same feature, except I'm bundling 3rd party CSS: in the case of modern-normalize, in it's entirety; in the case of TailwindCSS, a subset based on usage, but licensed code (MIT) nonetheless. |
Hi @timmb, The main problem here is that the glslify rollup plugin transform the code, and rollup has no way to know which modules have been loaded or not (another side effect is that files are not watchable by rollup as well). I updated the plugin implementation to make rollup aware of these files, you can see here. You can review the diff commit by commit, the last commit is where the "magic" happens. Basically, what I did:
Then, the file is correctly loaded, and everything works fine. I don't know if it could be simplified, I would love to see a way to force rollup to include modules in the chunk modules, that could make things way easier. |
@nborko could you share a test repo where I can reproduce? |
As I think about it, it's not really the same issue. The issue with tailwind is that it gets generated via a postcss plugin, so it's not being directly imported in a way that rollup can see it. But it would be nice if the license plugin had an option to add package names of packages that exist in node_modules as a dependency that get built into a bundled product, even if rollup doesn't itself see it during the bundling process. |
Off topic: For TailwindCSS, I must say that I think (but I am not a lawyer) that one does not have to include a banner for it. You are not bundling their code, just the output of the program. See my comments here and here, if you want to engage into discussion about that. Creator of TailwindCSS also claims there is no need to include a copyright notice. |
Since #380, the plugin no longer includes licenses for dependencies that have been removed through tree shaking. However, there are occasions where you want to keep them in.
In my case, I am using GLSL code from node modules which is being preprocessed and imported by glslify. The dependency is shaken out but the 3rd party code remains imported within my own GLSL code.
In this situation, it would be helpful to add an option to manually force certain node modules to have their licenses included.
For example,
The text was updated successfully, but these errors were encountered: