Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browser: true ignored when plugin-node-resolve 14 is used with plugin-typescript #1267

Closed
FranklinWhale opened this issue Sep 21, 2022 · 4 comments

Comments

@FranklinWhale
Copy link

FranklinWhale commented Sep 21, 2022

Expected Behavior

The diff returns no result

Actual Behavior

In NodeResolve14-TypeScript, TS and JS output are not the same. The outputs are the same in NodeResolve13-TypeScript.

Additional Information

This is probably caused by the use of order: "post" as part of #1245. Both plugin-typescript and plugin-typescript2 require plugin-node-resolve be run before themselves.

@pedrotorchio
Copy link

This could finally explain the issues I'm having. +1

@FranklinWhale
Copy link
Author

FranklinWhale commented Oct 5, 2022

@dkuhnert
Copy link

Same issue here. My workaround is to disable @rollup/plugin-typescript's resolveId and add .ts to @rollup/plugin-node-resolve extensions:

import typescriptPlugin from "@rollup/plugin-typescript";
import {nodeResolve as nodeResolvePlugin} from "@rollup/plugin-node-resolve";

const typescript = {
  ...typescriptPlugin(/* ... */),
  // do not resolve anything instead leave this to `@rollup/plugin-node-resolve`!
  // see also: https://github.com/rollup/plugins/issues/1267
  resolveId: undefined,
};
const nodeResolve = nodeResolvePlugin({
  extensions: [".mts", ".ts", ".cts", ".mjs", ".js", ".cjs", ".json", ".node"],
  mainFields: ["browser", "module", "jsnext:main", "main"],
});

// ...

@stale stale bot added the x⁷ ⋅ stale label Dec 31, 2022
@stale
Copy link

stale bot commented Jan 5, 2023

Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants