Compliant with Webpack license?

Is there a way to perform license compliance checks using webpack? Ideally, license headers from all modules generated by webpack are included in the final file, but how can we verify that this is the case?

Also is there a plugin that can detect license compatibility conflicts?

+3


source to share


1 answer


I am not a lawyer, so this is not legal advice.

You seem to be trying to solve two different problems: (1) understand the obligations to comply with packages installed via npm, (2) fulfill any obligations (for example, including the license on the output of the webpack).

For (1) tldrlegal is a useful tool that will print a summary of commitments. Since commitments can include requirements such as “display confirmation in all promotional materials”, it is difficult to perform compliance checking only one step in the build process (presumably when the webpack comes into play). It looks like this library can help in the compatibility aspect.



(2) The webpack Uglify plugin does this by default to fulfill obligations such as distributing licenses in source copies. The licenses of the packages listed in dependencies

your package.json are included by default in the build using the optioncomments

. ( It looks like this may change for webpack v4 .) Note that the dependency licenses listed in devDependencies

are not included in the embedded file.

To configure this explicitly, in your webpack config:

new webpack.optimize.UglifyJsPlugin({
  comments: /^\**!|@preserve|@license/,
})

      

+3


source







All Articles