From 6c10e19f9468b73e0eccae567e7a08a34a4c655a Mon Sep 17 00:00:00 2001 From: Anand Thakker Date: Mon, 16 Jul 2018 10:03:11 -0400 Subject: [PATCH] Include link to license in compiled bundle --- rollup.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index bd8db38119c..da2736d1381 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -2,6 +2,8 @@ import fs from 'fs'; import sourcemaps from 'rollup-plugin-sourcemaps'; import {plugins} from './build/rollup_plugins'; +const version = JSON.parse(fs.readFileSync('package.json')).version; + const production = process.env.BUILD === 'production'; const outputFile = production ? 'dist/mapbox-gl.js' : 'dist/mapbox-gl-dev.js'; @@ -35,7 +37,8 @@ const config = [{ format: 'umd', sourcemap: production ? true : 'inline', indent: false, - intro: fs.readFileSync(require.resolve('./rollup/bundle_prelude.js'), 'utf8') + intro: fs.readFileSync(require.resolve('./rollup/bundle_prelude.js'), 'utf8'), + banner: `/* Mapbox GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/mapbox/mapbox-gl-js/blob/v${version}/LICENSE.txt */` }, treeshake: false, plugins: [