-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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 license headers in js/dist files #27308
Conversation
Thanks for the PR @helmutgranda! @Johann-S do you think we could have the license header in a common place and use it in both scripts? |
FYI, I thought of doing so but I didn't know if the PR/Review process would be more drastic but for sure that is a more elegant approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the banner in a different file, I'll be good 👍
Thanks @helmutgranda 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With that changes it'll be good 👍
build/build-plugins.js
Outdated
@@ -67,6 +68,7 @@ Object.keys(bsPlugins) | |||
external | |||
}).then((bundle) => { | |||
bundle.write({ | |||
banner: banner, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
banner,
should be enough 😉
build/rollup.config.js
Outdated
* Copyright 2011-${year} ${pkg.author} | ||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
*/`, | ||
banner: banner, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
I'm gonna test it tomorrow but I quickly made the changes. |
ee29a76
to
5185edb
Compare
Works fine, thanks @helmutgranda! @Johann-S: maybe we should add the component's name like we did in v3? |
Yep I think it'll work 👍 |
By implementing the same approach of rollup.config.js and replicate it in build-plugins.js, individual plugins will display license headers.
5185edb
to
dd9cdc1
Compare
build/build-plugins.js
Outdated
@@ -8,6 +8,7 @@ | |||
const rollup = require('rollup') | |||
const path = require('path') | |||
const babel = require('rollup-plugin-babel') | |||
const banner = require(path.resolve(__dirname, './banner.js')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big fan of using path.resolve
here because require('./banner.js')
will works fine 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, let's change it
By implementing the same approach of rollup.config.js it can be replicated in build-plugins.js, with this approach individual plugins display license headers as expected.
Fixes #27301