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] Can this be used in compilerOptions? #64

Open
Andarist opened this issue Jan 6, 2020 · 7 comments
Open

[question] Can this be used in compilerOptions? #64

Andarist opened this issue Jan 6, 2020 · 7 comments

Comments

@Andarist
Copy link

Andarist commented Jan 6, 2020

I'm wondering if this plugin (or similar) can be added in compilerOptions.plugins? Or does that API doesn't accept transformer plugins?

@Brooooooklyn
Copy link
Contributor

This plugin is a transformer plugin, compilerOptions.plugins in tsconfig.json only accept Language service plugin, it's different.

@Brooooooklyn
Copy link
Contributor

@Andarist Do you have any plan to write a Language service plugin for emotion? Maybe I can help you.

@Andarist
Copy link
Author

Andarist commented Jan 6, 2020

I havent planned to write one, was interested only in transformer plugin for other project. It’s real bummer that those cannot be configured in regular way.

Do you have any ideas what language service plugin could do for emotion?

@nicmosc
Copy link

nicmosc commented Mar 4, 2020

What's the status on this? Emotion doesn't allow you to modify the label and sourceMaps options when you're "just" transpiling with tsc... real bummer. Anyone have an alternative solution ?

@Brooooooklyn
Copy link
Contributor

@nicmosc maybe you need https://github.com/cevek/ttypescript

@nicmosc
Copy link

nicmosc commented Mar 4, 2020

@Brooooooklyn thanks for the suggestion, the tool looks interesting but not sure how to use this plugin as a transformer, though you do mention above that this is a transformer plugin 🤔 tried this configuration, let me know if you can help out, otherwise i'll look further into it!

... rest of tsconfig.json
    "declaration": true,
    "declarationMap": true,
    "plugins": [
      {
        "transform": "emotion-ts-plugin",
        "import": "createEmotionPlugin",
        "sourceMap": false,
        "autoLabel": true,
        "labelFormat": "[filename]__[local]"
      }
    ]

@nicmosc
Copy link

nicmosc commented Mar 4, 2020

Scrap that, the transformer seems to be invoked correctly when using ttypescript's ttsc command, but the transpiled file seems to be the same still, autoLabel and labelFormat don't have any effect

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

3 participants