@@ -21,12 +21,12 @@ import typescript from 'rollup-plugin-typescript2';
2121 * @param title The title to use for the SDK, if not the package name
2222 * @returns An instance of the `rollup-plugin-license` plugin
2323 */
24- export function makeLicensePlugin ( title ) {
24+ function makeLicensePlugin ( title ) {
2525 const commitHash = require ( 'child_process' ) . execSync ( 'git rev-parse --short HEAD' , { encoding : 'utf-8' } ) . trim ( ) ;
2626
2727 return license ( {
2828 banner : {
29- content : `/*! <%= data.title || pkg.name %> <%= pkg.version %> (${ commitHash } ) | https://github.com/getsentry/sentry-javascript */` ,
29+ content : `/*! <%= data.title %> <%= pkg.version %> (${ commitHash } ) | https://github.com/getsentry/sentry-javascript */` ,
3030 data : { title } ,
3131 } ,
3232 } ) ;
@@ -56,7 +56,7 @@ export const terserPlugin = terser({
5656} ) ;
5757
5858export function makeBaseBundleConfig ( options ) {
59- const { input, isAddOn, jsVersion, outputFileBase } = options ;
59+ const { input, isAddOn, jsVersion, licenseTitle , outputFileBase } = options ;
6060
6161 const baseTSPluginOptions = {
6262 tsconfig : 'tsconfig.esm.json' ,
@@ -111,6 +111,8 @@ export function makeBaseBundleConfig(options) {
111111 } ,
112112 } ) ;
113113
114+ const licensePlugin = makeLicensePlugin ( licenseTitle ) ;
115+
114116 const standAloneBundleConfig = {
115117 output : {
116118 format : 'iife' ,
@@ -159,7 +161,12 @@ export function makeBaseBundleConfig(options) {
159161 strict : false ,
160162 esModule : false ,
161163 } ,
162- plugins : [ jsVersion === 'es5' ? typescriptPluginES5 : typescriptPluginES6 , markAsBrowserBuild , nodeResolvePlugin ] ,
164+ plugins : [
165+ jsVersion === 'es5' ? typescriptPluginES5 : typescriptPluginES6 ,
166+ markAsBrowserBuild ,
167+ nodeResolvePlugin ,
168+ licensePlugin ,
169+ ] ,
163170 treeshake : 'smallest' ,
164171 } ;
165172
0 commit comments