Skip to content

Commit 3ce08dd

Browse files
committed
move node resolve plugin to main rollup config
1 parent e7c9aec commit 3ce08dd

File tree

6 files changed

+21
-24
lines changed

6 files changed

+21
-24
lines changed

packages/browser/rollup.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { terser } from 'rollup-plugin-terser';
22
import typescript from 'rollup-plugin-typescript2';
3-
import resolve from '@rollup/plugin-node-resolve';
43

54
import {
65
baseBundleConfig,
76
makeLicensePlugin,
87
markAsBrowserBuild,
8+
nodeResolvePlugin,
99
paths,
1010
typescriptPluginES5,
1111
} from '../../rollup.config';
@@ -45,9 +45,7 @@ const plugins = [
4545
typescriptPluginES5,
4646
// replace `__SENTRY_BROWSER_BUNDLE__` with `true` to enable treeshaking of non-browser code
4747
markAsBrowserBuild,
48-
resolve({
49-
mainFields: ['module'],
50-
}),
48+
nodeResolvePlugin,
5149
];
5250

5351
const bundleConfig = {

packages/integrations/rollup.config.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import * as fs from 'fs';
22

33
import { terser } from 'rollup-plugin-terser';
4-
import resolve from '@rollup/plugin-node-resolve';
54
import commonjs from '@rollup/plugin-commonjs';
65

7-
import { addOnBundleConfig, baseBundleConfig, markAsBrowserBuild, typescriptPluginES5 } from '../../rollup.config';
6+
import {
7+
addOnBundleConfig,
8+
baseBundleConfig,
9+
markAsBrowserBuild,
10+
nodeResolvePlugin,
11+
typescriptPluginES5,
12+
} from '../../rollup.config';
813

914
const terserInstance = terser({
1015
mangle: {
@@ -24,9 +29,7 @@ const plugins = [
2429
typescriptPluginES5,
2530
// replace `__SENTRY_BROWSER_BUNDLE__` with `true` to enable treeshaking of non-browser code
2631
markAsBrowserBuild,
27-
resolve({
28-
mainFields: ['module'],
29-
}),
32+
nodeResolvePlugin,
3033
commonjs(),
3134
];
3235

packages/tracing/rollup.config.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import resolve from '@rollup/plugin-node-resolve';
2-
31
import {
42
baseBundleConfig,
53
makeLicensePlugin,
64
markAsBrowserBuild,
5+
nodeResolvePlugin,
76
terserPlugin,
87
typescriptPluginES5,
98
} from '../../rollup.config';
@@ -14,9 +13,7 @@ const plugins = [
1413
typescriptPluginES5,
1514
// replace `__SENTRY_BROWSER_BUNDLE__` with `true` to enable treeshaking of non-browser code
1615
markAsBrowserBuild,
17-
resolve({
18-
mainFields: ['module'],
19-
}),
16+
nodeResolvePlugin,
2017
licensePlugin,
2118
];
2219

packages/vue/rollup.config.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import resolve from '@rollup/plugin-node-resolve';
2-
31
import {
42
baseBundleConfig,
53
makeLicensePlugin,
64
markAsBrowserBuild,
5+
nodeResolvePlugin,
76
terserPlugin,
87
typescriptPluginES5,
98
} from '../../rollup.config';
@@ -14,9 +13,7 @@ const plugins = [
1413
typescriptPluginES5,
1514
// replace `__SENTRY_BROWSER_BUNDLE__` with `true` to enable treeshaking of non-browser code
1615
markAsBrowserBuild,
17-
resolve({
18-
mainFields: ['module'],
19-
}),
16+
nodeResolvePlugin,
2017
licensePlugin,
2118
];
2219

packages/wasm/rollup.config.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import resolve from '@rollup/plugin-node-resolve';
2-
31
import {
42
addOnBundleConfig,
53
baseBundleConfig,
64
markAsBrowserBuild,
5+
nodeResolvePlugin,
76
terserPlugin,
87
typescriptPluginES5,
98
} from '../../rollup.config';
@@ -12,9 +11,7 @@ const plugins = [
1211
typescriptPluginES5,
1312
// replace `__SENTRY_BROWSER_BUNDLE__` with `true` to enable treeshaking of non-browser code
1413
markAsBrowserBuild,
15-
resolve({
16-
mainFields: ['module'],
17-
}),
14+
nodeResolvePlugin,
1815
];
1916

2017
function loadAllIntegrations() {

rollup.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
import license from 'rollup-plugin-license';
6+
import resolve from '@rollup/plugin-node-resolve';
67
import replace from '@rollup/plugin-replace';
78
import { terser } from 'rollup-plugin-terser';
89
import typescript from 'rollup-plugin-typescript2';
@@ -73,6 +74,10 @@ export const typescriptPluginES5 = typescript({
7374
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
7475
});
7576

77+
export const nodeResolvePlugin = resolve({
78+
mainFields: ['module'],
79+
});
80+
7681
export const baseBundleConfig = {
7782
output: {
7883
sourcemap: true,

0 commit comments

Comments
 (0)