diff --git a/packages/node-resolve/src/index.js b/packages/node-resolve/src/index.js index 09ce84cd8..3d389383d 100644 --- a/packages/node-resolve/src/index.js +++ b/packages/node-resolve/src/index.js @@ -37,6 +37,7 @@ const defaults = { extensions: ['.mjs', '.js', '.json', '.node'], resolveOnly: [], moduleDirectories: ['node_modules'], + modulePaths: [], ignoreSideEffectsForRoot: false, // TODO: set to false in next major release or remove allowExportsFolderMapping: true diff --git a/packages/node-resolve/test/snapshots/test.mjs.md b/packages/node-resolve/test/snapshots/test.mjs.md index 7eccb2357..ab64d89de 100644 --- a/packages/node-resolve/test/snapshots/test.mjs.md +++ b/packages/node-resolve/test/snapshots/test.mjs.md @@ -4,6 +4,27 @@ The actual snapshot is saved in `test.mjs.snap`. Generated by [AVA](https://avajs.dev). +## has default config + +> Snapshot 1 + + { + allowExportsFolderMapping: true, + dedupe: [], + extensions: [ + '.mjs', + '.js', + '.json', + '.node', + ], + ignoreSideEffectsForRoot: false, + moduleDirectories: [ + 'node_modules', + ], + modulePaths: [], + resolveOnly: [], + } + ## throws error if local id is not resolved > Snapshot 1 diff --git a/packages/node-resolve/test/snapshots/test.mjs.snap b/packages/node-resolve/test/snapshots/test.mjs.snap index 84c150452..e8af19cf3 100644 Binary files a/packages/node-resolve/test/snapshots/test.mjs.snap and b/packages/node-resolve/test/snapshots/test.mjs.snap differ diff --git a/packages/node-resolve/test/test.mjs b/packages/node-resolve/test/test.mjs index 9318d4ea4..64cabc347 100755 --- a/packages/node-resolve/test/test.mjs +++ b/packages/node-resolve/test/test.mjs @@ -6,7 +6,7 @@ import commonjs from '@rollup/plugin-commonjs'; import test from 'ava'; import { rollup } from 'rollup'; -import { nodeResolve } from 'current-package'; +import { nodeResolve, DEFAULTS } from 'current-package'; import { evaluateBundle, getCode, getImports, testBundle } from '../../../util/test.js'; @@ -23,6 +23,10 @@ test('exposes plugin version', (t) => { t.regex(plugin.version, /^\d+\.\d+\.\d+/); }); +test('has default config', (t) => { + t.snapshot(DEFAULTS); +}); + test('finds a module with jsnext:main', async (t) => { const bundle = await rollup({ input: 'jsnext.js',