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

fix(v2): add @babel/preset-typescript to babel-loader #2310

Merged
merged 1 commit into from
Feb 23, 2020
Merged

fix(v2): add @babel/preset-typescript to babel-loader #2310

merged 1 commit into from
Feb 23, 2020

Conversation

deniaz
Copy link
Contributor

@deniaz deniaz commented Feb 21, 2020

Motivation

With #2221 docusaurus v2 is able to detect {ts,tsx} pages and components, but as soon as babel hits TypeScript syntax it fails. While the docusaurus babel.config.js includes @babel/preset-typescript, babel-loader inside the Webpack config does not.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

  1. Add typescript.tsx to your pages directory
  2. Add TypeScript syntax
import React from 'react';

export default () => {
  let name: string = 'World';

  return (
    <h1>Hello {name}!</h1>
  );
};
  1. Run docusaurus
  2. Check localhost:3000/typescript

Related PRs

#2221

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 21, 2020
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 80d495d

https://deploy-preview-2310--docusaurus-2.netlify.com

Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@yangshun yangshun added the pr: bug fix This PR fixes a bug in a past release. label Feb 23, 2020
@yangshun yangshun merged commit e54ede5 into facebook:master Feb 23, 2020
@yangshun yangshun changed the title chore(v2): Add @babel/preset-typescript to babel-loader fix(v2): add @babel/preset-typescript to babel-loader Feb 23, 2020
@lex111 lex111 added this to the v2.0.0-alpha.44 milestone Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants