Skip to content
Closed
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 dev-packages/node-core-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"scripts": {
"build": "run-s build:transpile build:types",
"build:dev": "yarn build",
"build:transpile": "rollup -c rollup.npm.config.mjs",
"build:transpile": "rolldown -c rollup.npm.config.mjs",
"build:types": "tsc -p tsconfig.types.json",
"clean": "rimraf -g **/node_modules && run-p clean:script",
"clean:script": "node scripts/clean.js",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/node-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"scripts": {
"build": "run-s build:transpile build:types",
"build:dev": "yarn build",
"build:transpile": "rollup -c rollup.npm.config.mjs",
"build:transpile": "rolldown -c rollup.npm.config.mjs",
"build:types": "tsc -p tsconfig.types.json",
"clean": "rimraf -g suites/**/node_modules suites/**/tmp_* && run-p clean:script",
"clean:script": "node scripts/clean.js",
Expand Down
17 changes: 3 additions & 14 deletions dev-packages/rollup-utils/bundleHelpers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ import deepMerge from 'deepmerge';
import {
makeBrowserBuildPlugin,
makeCleanupPlugin,
makeCommonJSPlugin,
makeIsDebugBuildPlugin,
makeJsonPlugin,
makeLicensePlugin,
makeNodeResolvePlugin,
makeRrwebBuildPlugin,
makeSetSDKSourcePlugin,
makeSucrasePlugin,
Expand All @@ -26,7 +23,6 @@ const BUNDLE_VARIANTS = ['.js', '.min.js', '.debug.min.js'];
export function makeBaseBundleConfig(options) {
const { bundleType, entrypoints, licenseTitle, outputFileBase, packageSpecificConfig, sucrase } = options;

const nodeResolvePlugin = makeNodeResolvePlugin();
const sucrasePlugin = makeSucrasePlugin({}, sucrase);
const cleanupPlugin = makeCleanupPlugin();
const markAsBrowserBuildPlugin = makeBrowserBuildPlugin(true);
Expand All @@ -36,13 +32,6 @@ export function makeBaseBundleConfig(options) {
excludeShadowDom: false,
});

// The `commonjs` plugin is the `esModuleInterop` of the bundling world. When used with `transformMixedEsModules`, it
// will include all dependencies, imported or required, in the final bundle. (Without it, CJS modules aren't included
// at all, and without `transformMixedEsModules`, they're only included if they're imported, not if they're required.)
const commonJSPlugin = makeCommonJSPlugin({ transformMixedEsModules: true });

const jsonPlugin = makeJsonPlugin();

// used by `@sentry/browser`
const standAloneBundleConfig = {
output: {
Expand Down Expand Up @@ -94,7 +83,7 @@ export function makeBaseBundleConfig(options) {
output: {
format: 'esm',
},
plugins: [commonJSPlugin, makeTerserPlugin(), licensePlugin],
plugins: [makeTerserPlugin(), licensePlugin],
// Don't bundle any of Node's core modules
external: builtinModules,
};
Expand All @@ -103,7 +92,7 @@ export function makeBaseBundleConfig(options) {
output: {
format: 'esm',
},
plugins: [commonJSPlugin, makeIsDebugBuildPlugin(true), makeTerserPlugin()],
plugins: [makeIsDebugBuildPlugin(true), makeTerserPlugin()],
// Don't bundle any of Node's core modules
external: builtinModules,
};
Expand All @@ -119,7 +108,7 @@ export function makeBaseBundleConfig(options) {
strict: false,
esModule: false,
},
plugins: [sucrasePlugin, nodeResolvePlugin, cleanupPlugin],
plugins: [sucrasePlugin, cleanupPlugin],
treeshake: 'smallest',
};

Expand Down
7 changes: 1 addition & 6 deletions dev-packages/rollup-utils/npmHelpers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { defineConfig } from 'rollup';
import {
makeCleanupPlugin,
makeDebugBuildStatementReplacePlugin,
makeNodeResolvePlugin,
makeRrwebBuildPlugin,
makeSucrasePlugin,
} from './plugins/index.mjs';
Expand All @@ -37,7 +36,6 @@ export function makeBaseNPMConfig(options = {}) {
bundledBuiltins = [],
} = options;

const nodeResolvePlugin = makeNodeResolvePlugin();
const sucrasePlugin = makeSucrasePlugin({}, sucrase);
const debugBuildStatementReplacePlugin = makeDebugBuildStatementReplacePlugin();
const cleanupPlugin = makeCleanupPlugin();
Expand All @@ -58,9 +56,6 @@ export function makeBaseNPMConfig(options = {}) {
// Include __esModule property when there is a default prop
esModule: 'if-default-prop',

// output individual files rather than one big bundle
preserveModules: true,

// Allow wrappers or helper functions generated by rollup to use any ES2015 features
generatedCode: {
preset: 'es2015',
Expand Down Expand Up @@ -96,7 +91,7 @@ export function makeBaseNPMConfig(options = {}) {
},
},

plugins: [nodeResolvePlugin, sucrasePlugin, debugBuildStatementReplacePlugin, rrwebBuildPlugin, cleanupPlugin],
plugins: [sucrasePlugin, debugBuildStatementReplacePlugin, rrwebBuildPlugin, cleanupPlugin],

// don't include imported modules from outside the package in the final output
external: [
Expand Down
11 changes: 0 additions & 11 deletions dev-packages/rollup-utils/plugins/bundlePlugins.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

import * as childProcess from 'child_process';

import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import terser from '@rollup/plugin-terser';
import license from 'rollup-plugin-license';
Expand Down Expand Up @@ -146,12 +144,3 @@ export function makeTerserPlugin() {
},
});
}

// We don't pass these plugins any options which need to be calculated or changed by us, so no need to wrap them in
// another factory function, as they are themselves already factory functions.

export function makeNodeResolvePlugin() {
return nodeResolve();
}

export { commonjs as makeCommonJSPlugin };
7 changes: 4 additions & 3 deletions dev-packages/rollup-utils/plugins/make-esm-plugin.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from 'node:fs';
import path from 'node:path';

/**
* Outputs a package.json file with {type: module} in the root of the output directory so that Node
Expand All @@ -11,9 +12,9 @@ export function makePackageNodeEsm() {
// We need to keep the `sideEffects` value from the original package.json,
// as e.g. webpack seems to depend on this
// without this, tree shaking does not work as expected
const packageJSONPath = (await this.resolve('package.json')).id;

const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath, 'utf-8'));
const packageJSON = JSON.parse(
fs.readFileSync(path.resolve(process.cwd(), './package.json'), { encoding: 'utf8' }),
);
const sideEffects = packageJSON.sideEffects;
// For module federation we need to keep the version of the package
const version = packageJSON.version;
Expand Down
4 changes: 0 additions & 4 deletions dev-packages/rollup-utils/plugins/npmPlugins.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ export function makeSucrasePlugin(options = {}, sucraseOptions = {}) {
);
}

export function makeJsonPlugin() {
return json();
}

/**
* Create a plugin which can be used to pause the build process at the given hook.
*
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"build": "run-s build:transpile build:types",
"build:tarball": "run-s build:transpile build:types",
"build:dev": "yarn build",
"build:transpile": "rollup -c rollup.npm.config.mjs",
"build:transpile": "rolldown -c rollup.npm.config.mjs",
"build:types": "tsc -p tsconfig.types.json",
"clean": "rimraf -g ./node_modules ./build"
},
Expand Down
1 change: 0 additions & 1 deletion dev-packages/test-utils/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default makeNPMConfigVariants(
output: {
// set exports to 'named' or 'auto' so that rollup doesn't warn
exports: 'named',
preserveModules: false,
},
},
}),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"prettier": "^3.6.2",
"prettier-plugin-astro": "^0.14.1",
"rimraf": "^5.0.10",
"rollup": "^4.35.0",
"rolldown": "^1.0.0-beta.45",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-license": "^3.3.1",
"size-limit": "~11.1.6",
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@
"scripts": {
"build": "run-p build:transpile build:types",
"build:dev": "yarn build",
"build:transpile": "rollup -c rollup.npm.config.mjs",
"build:transpile": "rolldown -c rollup.npm.config.mjs",
"build:types": "tsc -p tsconfig.types.json",
"build:watch": "run-p build:transpile:watch build:types:watch",
"build:dev:watch": "yarn build:watch",
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
"build:transpile:watch": "rolldown -c rollup.npm.config.mjs --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:tarball": "npm pack",
"circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { makeBaseNPMConfig, makeNPMConfigVariants, makeOtelLoaders } from '@sent

const variants = makeNPMConfigVariants(
makeBaseNPMConfig({
entrypoints: ['src/index.server.ts', 'src/index.client.ts', 'src/integration/middleware/index.ts'],
entrypoints: ['src/index.server.ts', 'src/index.client.ts', 'src/integration/middleware/middleware.ts'],
packageSpecificConfig: {
output: {
dynamicImportInCjs: true,
Expand Down
6 changes: 3 additions & 3 deletions packages/aws-serverless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@
},
"scripts": {
"build": "run-p build:transpile build:types",
"build:layer": "rimraf build/aws && rollup -c rollup.lambda-extension.config.mjs && yarn ts-node scripts/buildLambdaLayer.ts",
"build:layer": "rimraf build/aws && rolldown -c rollup.lambda-extension.config.mjs && yarn ts-node scripts/buildLambdaLayer.ts",
"build:dev": "run-p build:transpile build:types",
"build:transpile": "rollup -c rollup.npm.config.mjs && yarn build:layer",
"build:transpile": "rolldown -c rollup.npm.config.mjs && yarn build:layer",
"build:types": "run-s build:types:core build:types:downlevel",
"build:types:core": "tsc -p tsconfig.types.json",
"build:types:downlevel": "yarn downlevel-dts build/npm/types build/npm/types-ts3.8 --to ts3.8",
"build:watch": "run-p build:transpile:watch build:types:watch",
"build:dev:watch": "yarn build:watch",
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
"build:transpile:watch": "rolldown -c rollup.npm.config.mjs --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:tarball": "npm pack",
"circularDepCheck": "madge --circular src/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/browser-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
"scripts": {
"build": "run-p build:transpile build:types",
"build:dev": "yarn build",
"build:transpile": "rollup -c rollup.npm.config.mjs",
"build:transpile": "rolldown -c rollup.npm.config.mjs",
"build:types": "run-s build:types:core build:types:downlevel",
"build:types:core": "tsc -p tsconfig.types.json",
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
"build:watch": "run-p build:transpile:watch build:types:watch",
"build:dev:watch": "run-p build:transpile:watch build:types:watch",
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
"build:transpile:watch": "rolldown -c rollup.npm.config.mjs --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:tarball": "npm pack",
"clean": "rimraf build coverage sentry-internal-browser-utils-*.tgz",
Expand Down
5 changes: 0 additions & 5 deletions packages/browser-utils/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ export default makeNPMConfigVariants(
output: {
// set exports to 'named' or 'auto' so that rollup doesn't warn
exports: 'named',
// set preserveModules to true because we don't want to bundle everything into one file.
preserveModules:
process.env.SENTRY_BUILD_PRESERVE_MODULES === undefined
? true
: Boolean(process.env.SENTRY_BUILD_PRESERVE_MODULES),
},
},
}),
Expand Down
8 changes: 4 additions & 4 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
"scripts": {
"build": "run-p build:transpile build:bundle build:types",
"build:dev": "run-p build:transpile build:types",
"build:bundle": "rollup -c rollup.bundle.config.mjs",
"build:transpile": "rollup -c rollup.npm.config.mjs",
"build:bundle": "rolldown -c rollup.bundle.config.mjs",
"build:transpile": "rolldown -c rollup.npm.config.mjs",
"build:types": "run-s build:types:core build:types:downlevel",
"build:types:core": "tsc -p tsconfig.types.json",
"build:types:downlevel": "yarn downlevel-dts build/npm/types build/npm/types-ts3.8 --to ts3.8",
"build:watch": "run-p build:transpile:watch build:bundle:watch build:types:watch",
"build:dev:watch": "run-p build:transpile:watch build:types:watch",
"build:bundle:watch": "rollup -c rollup.bundle.config.mjs --watch",
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
"build:bundle:watch": "rolldown -c rollup.bundle.config.mjs --watch",
"build:transpile:watch": "rolldown -c rollup.npm.config.mjs --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:tarball": "npm pack",
"circularDepCheck": "madge --circular src/index.ts",
Expand Down
5 changes: 0 additions & 5 deletions packages/browser/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ export default makeNPMConfigVariants(
output: {
// set exports to 'named' or 'auto' so that rollup doesn't warn
exports: 'named',
// set preserveModules to true because we don't want to bundle everything into one file.
preserveModules:
process.env.SENTRY_BUILD_PRESERVE_MODULES === undefined
? true
: Boolean(process.env.SENTRY_BUILD_PRESERVE_MODULES),
},
},
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
"scripts": {
"build": "run-p build:transpile build:types",
"build:dev": "yarn build",
"build:transpile": "rollup -c rollup.npm.config.mjs",
"build:transpile": "rolldown -c rollup.npm.config.mjs",
"build:types": "run-s build:types:core build:types:downlevel",
"build:types:core": "tsc -p tsconfig.types.json",
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
"build:watch": "run-p build:transpile:watch build:types:watch",
"build:dev:watch": "yarn build:watch",
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
"build:transpile:watch": "rolldown -c rollup.npm.config.mjs --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:tarball": "npm pack",
"circularDepCheck": "madge --circular src/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
"scripts": {
"build": "run-p build:transpile build:types",
"build:dev": "yarn build",
"build:transpile": "rollup -c rollup.npm.config.mjs",
"build:transpile": "rolldown -c rollup.npm.config.mjs",
"build:types": "run-s build:types:core build:types:downlevel",
"build:types:core": "tsc -p tsconfig.types.json",
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
"build:watch": "run-p build:transpile:watch build:types:watch",
"build:dev:watch": "yarn build:watch",
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
"build:transpile:watch": "rolldown -c rollup.npm.config.mjs --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:tarball": "npm pack",
"circularDepCheck": "madge --circular src/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
"scripts": {
"build": "run-p build:transpile build:types",
"build:dev": "yarn build",
"build:transpile": "rollup -c rollup.npm.config.mjs",
"build:transpile": "rolldown -c rollup.npm.config.mjs",
"build:types": "run-s build:types:core build:types:downlevel",
"build:types:core": "tsc -p tsconfig.types.json",
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
"build:watch": "run-p build:transpile:watch build:types:watch",
"build:dev:watch": "yarn build:watch",
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
"build:transpile:watch": "rolldown -c rollup.npm.config.mjs --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:tarball": "npm pack",
"circularDepCheck": "madge --circular src/index.ts",
Expand Down
5 changes: 0 additions & 5 deletions packages/core/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ export default makeNPMConfigVariants(
output: {
// set exports to 'named' or 'auto' so that rollup doesn't warn
exports: 'named',
// set preserveModules to true because we don't want to bundle everything into one file.
preserveModules:
process.env.SENTRY_BUILD_PRESERVE_MODULES === undefined
? true
: Boolean(process.env.SENTRY_BUILD_PRESERVE_MODULES),
},
plugins: [
replace({
Expand Down
2 changes: 1 addition & 1 deletion packages/deno/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"deno-types": "node ./scripts/download-deno-types.mjs",
"build": "run-s build:transpile build:types",
"build:dev": "yarn build",
"build:transpile": "yarn deno-types && rollup -c rollup.npm.config.mjs",
"build:transpile": "yarn deno-types && rolldown -c rollup.npm.config.mjs",
"build:types": "tsc -p tsconfig.types.json",
"build:tarball": "npm pack",
"circularDepCheck": "madge --circular src/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/feedback/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
},
"scripts": {
"build": "run-p build:transpile build:types build:bundle",
"build:transpile": "rollup -c rollup.npm.config.mjs",
"build:bundle": "rollup -c rollup.bundle.config.mjs",
"build:transpile": "rolldown -c rollup.npm.config.mjs",
"build:bundle": "rolldown -c rollup.bundle.config.mjs",
"build:dev": "run-p build:transpile build:types",
"build:types": "run-s build:types:core build:types:downlevel",
"build:types:core": "tsc -p tsconfig.types.json",
Expand Down
6 changes: 0 additions & 6 deletions packages/feedback/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ export default makeNPMConfigVariants(
output: {
// set exports to 'named' or 'auto' so that rollup doesn't warn
exports: 'named',
// set preserveModules to false because for feedback we actually want
// to bundle everything into one file.
preserveModules:
process.env.SENTRY_BUILD_PRESERVE_MODULES === undefined
? false
: Boolean(process.env.SENTRY_BUILD_PRESERVE_MODULES),
},
},
sucrase: {
Expand Down
Loading
Loading