Skip to content

Commit 02c0077

Browse files
committed
Set preferBuiltins: true to remove warning
1 parent d715def commit 02c0077

2 files changed

Lines changed: 38 additions & 8 deletions

File tree

src/__tests__/__snapshots__/createRollupConfig.test.ts.snap

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
exports[`rollup plugins default build plugins with sideEffects: false 1`] = `
44
Array [
5-
"@rollup/plugin-resolve",
5+
Object {
6+
"calledWith": Object {
7+
"preferBuiltins": true,
8+
},
9+
"name": "@rollup/plugin-resolve",
10+
},
611
"@rollup/plugin-commonjs",
712
"@rollup/plugin-json",
813
Object {
@@ -53,7 +58,12 @@ Array [
5358

5459
exports[`rollup plugins default build plugins with sideEffects: true 1`] = `
5560
Array [
56-
"@rollup/plugin-resolve",
61+
Object {
62+
"calledWith": Object {
63+
"preferBuiltins": true,
64+
},
65+
"name": "@rollup/plugin-resolve",
66+
},
5767
"@rollup/plugin-commonjs",
5868
"@rollup/plugin-json",
5969
Object {
@@ -104,7 +114,12 @@ Array [
104114

105115
exports[`rollup plugins dev build plugins with sideEffects: false 1`] = `
106116
Array [
107-
"@rollup/plugin-resolve",
117+
Object {
118+
"calledWith": Object {
119+
"preferBuiltins": true,
120+
},
121+
"name": "@rollup/plugin-resolve",
122+
},
108123
"@rollup/plugin-commonjs",
109124
"@rollup/plugin-json",
110125
Object {
@@ -161,7 +176,12 @@ Array [
161176

162177
exports[`rollup plugins dev build plugins with sideEffects: true 1`] = `
163178
Array [
164-
"@rollup/plugin-resolve",
179+
Object {
180+
"calledWith": Object {
181+
"preferBuiltins": true,
182+
},
183+
"name": "@rollup/plugin-resolve",
184+
},
165185
"@rollup/plugin-commonjs",
166186
"@rollup/plugin-json",
167187
Object {
@@ -233,7 +253,12 @@ Array [
233253

234254
exports[`rollup plugins prod build plugins with sideEffects: false 1`] = `
235255
Array [
236-
"@rollup/plugin-resolve",
256+
Object {
257+
"calledWith": Object {
258+
"preferBuiltins": true,
259+
},
260+
"name": "@rollup/plugin-resolve",
261+
},
237262
"@rollup/plugin-commonjs",
238263
"@rollup/plugin-json",
239264
Object {
@@ -290,7 +315,12 @@ Array [
290315

291316
exports[`rollup plugins prod build plugins with sideEffects: true 1`] = `
292317
Array [
293-
"@rollup/plugin-resolve",
318+
Object {
319+
"calledWith": Object {
320+
"preferBuiltins": true,
321+
},
322+
"name": "@rollup/plugin-resolve",
323+
},
294324
"@rollup/plugin-commonjs",
295325
"@rollup/plugin-json",
296326
Object {

src/rollupBuilds.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
RollupBuild,
1111
RollupOutput,
1212
} from 'rollup';
13-
import resolveRollup from '@rollup/plugin-node-resolve';
13+
import nodeResolve from '@rollup/plugin-node-resolve';
1414
import commonjs from '@rollup/plugin-commonjs';
1515
import json from '@rollup/plugin-json';
1616
import rollupTypescript from 'rollup-plugin-typescript2';
@@ -58,7 +58,7 @@ export const createRollupConfig: CreateRollupConfig = ({
5858
pkgJsonUmdGlobalDependencies,
5959
}) => {
6060
const buildPluginsDefault: Plugin[] = [
61-
resolveRollup(),
61+
nodeResolve({ preferBuiltins: true }),
6262
commonjs(),
6363
json(),
6464
rollupTypescript({

0 commit comments

Comments
 (0)