Webpack 捆绑许可证合规性?
Webpack bundle license compliance?
有没有办法使用 webpack 执行许可证合规性检查?理想情况下,由 webpack 构建的所有模块的许可证 headers 都包含在最终输出文件中,但我们如何检查情况是否如此?
还有可以检测许可证兼容性冲突的插件吗?
我不是律师,所以这不是法律建议。
您似乎在尝试解决两个不同的问题:(1) 了解通过 npm 安装的软件包的合规义务,(2) 履行任何义务(例如,在 webpack 的输出中包含许可证)。
对于 (1) tldrlegal is a helpful tool that will print a highlevel summary of obligations. Since obligations could include requirements like "display an acknowledgement in all advertising materials", it's hard to boil compliance checks down to just a step in the build process (which is presumably when webpack would come into play). It looks like this library 可能有助于兼容性方面。
(2) 为了遵守在源副本中分发许可证等义务,webpack 的 Uglify 插件默认执行此操作。 package.json 的 dependencies
中列出的软件包许可证默认包含在构建 via the comments
option. (It looks like this may be changing for webpack v4 中。)请注意,devDependencies
中列出的依赖项许可证不包含在 devDependencies
中构建的文件。
要明确配置它,请在您的 webpack 配置中包括:
new webpack.optimize.UglifyJsPlugin({
comments: /^\**!|@preserve|@license/,
})
如果在 dependencies
或 devDependencies
下定义了依赖项和由此产生的传递依赖项,对于解决该依赖项是否包含在 webpack 构建输出中的问题没有帮助。尝试 webpack-license-plugin,它可能会帮助您解决问题。
如有疑问,欢迎随时提问。我是该模块的维护者,所以我可以提供帮助!
有没有办法使用 webpack 执行许可证合规性检查?理想情况下,由 webpack 构建的所有模块的许可证 headers 都包含在最终输出文件中,但我们如何检查情况是否如此?
还有可以检测许可证兼容性冲突的插件吗?
我不是律师,所以这不是法律建议。
您似乎在尝试解决两个不同的问题:(1) 了解通过 npm 安装的软件包的合规义务,(2) 履行任何义务(例如,在 webpack 的输出中包含许可证)。
对于 (1) tldrlegal is a helpful tool that will print a highlevel summary of obligations. Since obligations could include requirements like "display an acknowledgement in all advertising materials", it's hard to boil compliance checks down to just a step in the build process (which is presumably when webpack would come into play). It looks like this library 可能有助于兼容性方面。
(2) 为了遵守在源副本中分发许可证等义务,webpack 的 Uglify 插件默认执行此操作。 package.json 的 dependencies
中列出的软件包许可证默认包含在构建 via the comments
option. (It looks like this may be changing for webpack v4 中。)请注意,devDependencies
中列出的依赖项许可证不包含在 devDependencies
中构建的文件。
要明确配置它,请在您的 webpack 配置中包括:
new webpack.optimize.UglifyJsPlugin({
comments: /^\**!|@preserve|@license/,
})
如果在 dependencies
或 devDependencies
下定义了依赖项和由此产生的传递依赖项,对于解决该依赖项是否包含在 webpack 构建输出中的问题没有帮助。尝试 webpack-license-plugin,它可能会帮助您解决问题。
如有疑问,欢迎随时提问。我是该模块的维护者,所以我可以提供帮助!