Skip to content

Commit 7525490

Browse files
authored
chore(build): Remove default @rollup/plugin-node-resolve option (#4639)
According to the `@rollup/plugin-node-resolve` docs[1], the `mainFields` option tells the plugin what field in `package.json` to use as an entry point. The default value is `['module', 'main']`, and the plugin will use the first element of the array for which it finds a match in `package.json`. All of our `package.json` files have a `module` entry, which is reflected in the fact that we've had `mainFields` set to `['module']`. But that of course leads to the same outcome as the just using the default would - there's a match on `'module'`, and so that's what's used. This PR therefore removes the option in favor of using the default. As would be expected, there is no change in the bundle content. [1] https://github.com/rollup/plugins/tree/master/packages/node-resolve#mainfields
1 parent 32edb0b commit 7525490

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

rollup.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ export const typescriptPluginES5 = typescript({
7474
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
7575
});
7676

77-
export const nodeResolvePlugin = resolve({
78-
mainFields: ['module'],
79-
});
77+
export const nodeResolvePlugin = resolve();
8078

8179
export const baseBundleConfig = {
8280
output: {

0 commit comments

Comments
 (0)