From a8952f6c000e2d6a9ad28bf702deebc0ee8ab8e1 Mon Sep 17 00:00:00 2001 From: Christopher Rogers Date: Thu, 16 Jul 2020 12:00:24 -0700 Subject: [PATCH] Adds open source attribution comment --- index.js | 5 +++++ webpack.config.js | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index df0a8c293..5c27c32ca 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,8 @@ +/** + * License information available at https://docs.recurly.com/page/open-source-attribution + * @attribution + */ + import recurlyCSS from './lib/recurly.css'; import { Recurly } from './lib/recurly'; diff --git a/webpack.config.js b/webpack.config.js index 8a3e5f906..e7ba95844 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,6 +5,8 @@ const path = require('path'); const minify = ~process.argv.indexOf('-p'); const manifest = require('./package.json'); +const ATTRIBUTION_URL = 'https://docs.recurly.com/page/open-source-attribution'; + module.exports = { node: { global: false, @@ -68,10 +70,13 @@ module.exports = { new TerserPlugin({ terserOptions: { output: { - comments: false, + comments: false }, }, - extractComments: false + extractComments: { + condition: /@attribution/i, + banner: () => `License information available at ${ATTRIBUTION_URL}` + } }), new OptimizeCSSAssetsPlugin({}) ]