![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
license-banner-webpack-plugin
Advanced tools
Insert the license text of the module used for each bundled file at the beginning of each.
$ yarn add license-banner-webpack-plugin --dev
# or
$ npm install license-banner-webpack-plugin --save-dev
Import the plugin module into webpack configuration.
const LicenseBannerPlugin = require('license-banner-webpack-plugin');
Then use this plugin with some options.
new LicenseBannerPlugin({
licenseTemplate: function(pkg) {
return `${pkg.name}, ${pkg.version}, ${pkg.author}, ${pkg.license}, ${pkg.repository}`;
},
licenseDirectories: [
path.join('/path/to/node_modules')
]
});
Then output file has license banner like this.
/*
webpack@2.2.1
license: MIT
author: Tobias Koppers @sokra
repository: https://github.com/webpack/webpack.git:
(...and any other modules you use in your code)
*/
new LicenseBannerPlugin(options);
name | type | description |
---|---|---|
licenseTemplate(pkg) | Function | license template pattern. argument pkg is each packages information object. you can use pkg.name pkg.version pkg.author pkg.license pkg.repository . |
licenseDirectories | Array | package modules directories. The default is node_modules directory. |
If you want to remove all other comments, use uglifyjs-webpack-plugin
instead of plugins in webpack.
$ npm install uglifyjs-webpack-plugin --save-dev
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
and also you must be set behind UglifyJSPlugin.
// ...
plugins: [
new UglifyJSPlugin(),
new LicenseBannerPlugin()
]
// ...
mode
option has added from webpack v4.
If you use production
mode and also want to use license-banner-webpack-plugin, you must set optimization.minimize
option to false
.
// ...
mode: 'production',
optimization: {
minimize: false
}
// ...
FAQs
append license banner to bundle file.
The npm package license-banner-webpack-plugin receives a total of 7 weekly downloads. As such, license-banner-webpack-plugin popularity was classified as not popular.
We found that license-banner-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.