Skip to content

build(cdn): Make integration CDN bundles build in parallel #7621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/integrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"scripts": {
"build": "run-p build:transpile build:types build:bundle",
"build:bundle": "ts-node scripts/buildBundles.ts",
"build:bundle": "ts-node scripts/buildBundles.ts --parallel",
"build:dev": "run-p build:transpile build:types",
"build:transpile": "rollup -c rollup.npm.config.js",
"build:types": "tsc -p tsconfig.types.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/rollup.bundle.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const baseBundleConfig = makeBaseBundleConfig({
entrypoints: [`src/${file}`],
jsVersion,
licenseTitle: '@sentry/integrations',
outputFileBase: ({ name: entrypoint }) => `bundles/${entrypoint}${jsVersion === 'ES5' ? '.es5' : ''}`,
outputFileBase: ({ name: entrypoint }) => `bundles/${entrypoint}${jsVersion === 'es5' ? '.es5' : ''}`,
});

// TODO We only need `commonjs` for localforage (used in the offline plugin). Once that's fixed, this can come out.
Expand Down
6 changes: 3 additions & 3 deletions packages/integrations/scripts/buildBundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function buildBundle(integration: string, jsVersion: string): Promise<void
if (runParallel) {
// We're building a bundle for each integration and each JavaScript version.
const tasks = getIntegrations().reduce(
(tasks, integration) => [...tasks, buildBundle(integration, 'ES5'), buildBundle(integration, 'ES6')],
(tasks, integration) => [...tasks, buildBundle(integration, 'es5'), buildBundle(integration, 'es6')],
[] as Promise<void>[],
);

Expand All @@ -49,8 +49,8 @@ if (runParallel) {
} else {
void (async () => {
for (const integration of getIntegrations()) {
await buildBundle(integration, 'ES5');
await buildBundle(integration, 'ES6');
await buildBundle(integration, 'es5');
await buildBundle(integration, 'es6');
}
// eslint-disable-next-line no-console
console.log('\nIntegration bundles built successfully');
Expand Down