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

[Question] how to transpile 'components/Fragment.tsx' #1

Open
GuanJdoJ opened this issue Jul 25, 2023 · 0 comments
Open

[Question] how to transpile 'components/Fragment.tsx' #1

GuanJdoJ opened this issue Jul 25, 2023 · 0 comments

Comments

@GuanJdoJ
Copy link

//server.js
...
server.get(path, (req, res) =>
    serveFragment(
      req,
      res,
      fragmentID => require(`./components/${fragmentID}`).default
    )
  )
...

In server.js, the resovle will get Component from dist which was transpiled by babel.

//.babelrc
{
  "presets": ["next/babel"]
}

When fragment component is js, babel works well. But when fragment component is tsx, babel doesn't handle it. And when I import less in components/Fragment.tsx, the style file will not be transpiled to dist.

Could you please tell me what should I do, thx!

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

No branches or pull requests

1 participant