Skip to content

TypeScript support #36

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

Open
gallafent opened this issue Apr 17, 2019 · 2 comments
Open

TypeScript support #36

gallafent opened this issue Apr 17, 2019 · 2 comments

Comments

@gallafent
Copy link

First, really pleased to see this, and I'd like to move at least part of our project to use single-file components as we go forward ... but we use TypeScript, and as I understand it (and from a brief skim of the sources) only JavaScript is supported inside the <script> element.

It would be excellent to see support for TypeScript in the <script> element of the .lit single file :)

@LasaleFamine
Copy link
Member

Hi @gallafent, thank you for trying the lit-loader.

Actually I think this could be easy to achieve: instead of using, for example, the babel-loader, as stated in the Readme, you can use something like ts-loader and using it like:

module: {
    rules: [
      {
        test: /\.lit$/,
        use: ['ts-loader', 'lit-loader']
      }
    ]
  }

This should work, since the lit-loader is extracting the js inside the <script> tag and pass it to ts-loader.

Let me know if it will work.

@gallafent
Copy link
Author

Aha, of course! ... I will try it and report back!

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