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

Sucrase support #1008

Open
iki opened this issue Jun 6, 2018 · 1 comment
Open

Sucrase support #1008

iki opened this issue Jun 6, 2018 · 1 comment

Comments

@iki
Copy link

iki commented Jun 6, 2018

Is there any way how the hot loader could work directly with sucrase? Currently it requires the slow babel step to transpile typescript into es6 (alangpierce/sucrase#228):

 // Load TypeScript (.ts, .tsx).
      {
        test: /\.tsx?$/,
        use: [
          ...(isDevServer
            ? [
                {
                  loader: 'babel-loader',
                  options: {
                    babelrc: false,
                    plugins: ['react-hot-loader/babel'],
                  },
                },
              ]
            : []),
          ...(targetES6
            ? [
                {
                  loader: '@sucrase/webpack-loader',
                  options: {
                    transforms: ['imports', 'jsx', 'typescript'],
                  },
                },
              ]
            : [{ loader: 'ts-loader', options: { configFile: paths.tsConfig } }]),
        ],
      },
@theKashey
Copy link
Collaborator

So, it's up Sucrase.

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

2 participants