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

[Bug] buildSync api do not respect tsconfig.json when use stdin input. #385

Closed
Akimyou opened this issue Sep 13, 2020 · 0 comments
Closed
Labels

Comments

@Akimyou
Copy link

Akimyou commented Sep 13, 2020

I config "jsxFactory": "h" and "jsxFragmentFactory": "Fragment" in tsconfig.json.

When use entryPoints: ['./test-tsx.tsx'], the result is correct.

const { warnings, outputFiles } = buildSync({
  tsconfig: './tsconfig.json',
  entryPoints: ['./test-tsx.tsx'],
//   stdin: {
//       contents: testTsxContent,
//       loader: 'tsx',
//   },
  write: false,
})

Result:

const render = () => {
  return /* @__PURE__ */ h(Fragment, null, /* @__PURE__ */ h("h1", null, "Hello"));
};

When use stdin, the result is different, seems like not respect tsconfig.json.

const render = () => {
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("h1", null, "Hello"));
};

Please try on this repo: https://github.com/Akimyou/esbuild-register/tree/feature/test-esbuild

node ./test-esbuild.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants