Skip to content

Commit

Permalink
fix(dev-server-rollup): skip resolve if skipSelf is set
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Aug 25, 2021
1 parent 0105abd commit ebd24b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ export function createRollupPluginContextAdapter<
if (!context) throw new Error('Context is required.');

for (const pl of config.plugins ?? []) {
if (
pl.resolveImport &&
(!options.skipSelf || pl.resolveImport !== wdsPlugin.resolveImport)
) {
if (pl.resolveImport && pl.resolveImport !== wdsPlugin.resolveImport && !options.skipSelf) {
const result = await pl.resolveImport({ source, context });
let resolvedId: string | undefined;
if (typeof result === 'string') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ describe('@rollup/plugin-node-resolve', () => {
}
});

// Fails after upgrading @rollup/plugin-node-resolve to 13.0.0
// See https://github.com/modernweb-dev/web/issues/1568
it.skip('node modules resolved outside root directory are rewritten with commonjs', async () => {
it('node modules resolved outside root directory are rewritten with commonjs', async () => {
const { server, host } = await createTestServer({
rootDir: path.resolve(__dirname, '..', 'fixtures', 'resolve-outside-dir', 'src'),
plugins: [commonjs(), nodeResolve()],
Expand Down

0 comments on commit ebd24b2

Please sign in to comment.