diff --git a/.changeset/thick-carpets-laugh.md b/.changeset/thick-carpets-laugh.md new file mode 100644 index 00000000..d134afa1 --- /dev/null +++ b/.changeset/thick-carpets-laugh.md @@ -0,0 +1,5 @@ +--- +"@theoplayer/conviva-connector-web": patch +--- + +Fixed an issue where the THEOplayer library and the Yospace connector were accidentally bundled together with the Conviva connector. diff --git a/cmcd/rollup.config.mjs b/cmcd/rollup.config.mjs index 570798e8..07c53377 100644 --- a/cmcd/rollup.config.mjs +++ b/cmcd/rollup.config.mjs @@ -10,4 +10,4 @@ const banner = ` * THEOplayer CMCD Connector v${version} */`.trim(); -export default getSharedBuildConfiguration(fileName, globalName, banner); +export default getSharedBuildConfiguration({ fileName, globalName, banner }); diff --git a/conviva/rollup.config.mjs b/conviva/rollup.config.mjs index a9f8ae73..562d78d6 100644 --- a/conviva/rollup.config.mjs +++ b/conviva/rollup.config.mjs @@ -9,6 +9,10 @@ const banner = ` /** * THEOplayer Conviva Connector v${version} */`.trim(); +const external = ['@convivainc/conviva-js-coresdk', '@theoplayer/yospace-connector-web']; +const globals = { + '@convivainc/conviva-js-coresdk': 'Conviva', + '@theoplayer/yospace-connector-web': 'THEOplayerYospaceConnector' +}; - -export default getSharedBuildConfiguration(fileName, globalName, banner); +export default getSharedBuildConfiguration({ fileName, globalName, banner, external, globals }); diff --git a/nielsen/rollup.config.mjs b/nielsen/rollup.config.mjs index 30a21542..c2b093ce 100644 --- a/nielsen/rollup.config.mjs +++ b/nielsen/rollup.config.mjs @@ -11,4 +11,4 @@ const banner = ` * Nielsen Web Connector v${version} */`.trim(); -export default getSharedBuildConfiguration(fileName, globalName, banner); +export default getSharedBuildConfiguration({ fileName, globalName, banner }); diff --git a/tools/build.mjs b/tools/build.mjs index d1bf5c63..7d4bbf90 100644 --- a/tools/build.mjs +++ b/tools/build.mjs @@ -1,61 +1,66 @@ -import {defineConfig} from "rollup"; -import nodeResolve from "@rollup/plugin-node-resolve"; -import commonjs from "@rollup/plugin-commonjs"; -import typescript from "@rollup/plugin-typescript"; -import dts from "rollup-plugin-dts"; +import { defineConfig } from 'rollup'; +import nodeResolve from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; +import typescript from '@rollup/plugin-typescript'; +import dts from 'rollup-plugin-dts'; -export function getSharedBuildConfiguration(fileName, globalName, banner) { - return defineConfig([{ - input: { - [fileName]: "src/index.ts" - }, - output: [ - { - dir: "dist", - entryFileNames: "[name].umd.js", - name: globalName, - format: "umd", - indent: false, - banner, - globals: {theoplayer: "THEOplayer"} +export function getSharedBuildConfiguration({ fileName, globalName, banner, external, globals }) { + return defineConfig([ + { + input: { + [fileName]: 'src/index.ts' }, - { - dir: "dist", - entryFileNames: "[name].esm.js", - format: "esm", - indent: false, - banner - } - ], - plugins: [ - nodeResolve({ - extensions: [".ts", ".js"] - }), - commonjs({ - include: ['node_modules/**', '../node_modules/**'] - }), - typescript({ - tsconfig: "tsconfig.json", - module: "es2015", - include: ["src/**/*"] - }) - ] - }, { - input: { - [fileName]: "src/index.ts" + output: [ + { + dir: 'dist', + entryFileNames: '[name].umd.js', + name: globalName, + format: 'umd', + indent: false, + banner, + globals: { theoplayer: 'THEOplayer', ...(globals ?? {}) } + }, + { + dir: 'dist', + entryFileNames: '[name].esm.js', + format: 'esm', + indent: false, + banner + } + ], + external: ['theoplayer', ...(external ?? [])], + plugins: [ + nodeResolve({ + extensions: ['.ts', '.js'] + }), + commonjs({ + include: ['node_modules/**', '../node_modules/**'] + }), + typescript({ + tsconfig: 'tsconfig.json', + module: 'es2015', + include: ['src/**/*'] + }) + ] }, - output: [ - { - dir: "dist", - format: "esm", - banner, - footer: `export as namespace ${globalName};` - } - ], - plugins: [ - dts({ - tsconfig: "tsconfig.json", - }) - ] - }]); -} \ No newline at end of file + { + input: { + [fileName]: 'src/index.ts' + }, + output: [ + { + dir: 'dist', + format: 'esm', + banner, + footer: `export as namespace ${globalName};` + } + ], + external: ['theoplayer', ...(external ?? [])], + plugins: [ + dts({ + tsconfig: 'tsconfig.json' + }) + ] + } + ]); +} diff --git a/yospace/rollup.config.mjs b/yospace/rollup.config.mjs index a815f84f..d575d428 100644 --- a/yospace/rollup.config.mjs +++ b/yospace/rollup.config.mjs @@ -10,4 +10,4 @@ const banner = ` * THEOplayer Yospace Connector v${version} */`.trim(); -export default getSharedBuildConfiguration(fileName, globalName, banner); \ No newline at end of file +export default getSharedBuildConfiguration({ fileName, globalName, banner });