Open trusktr opened 7 years ago
Hm ... that's an interesting problem that I'm not sure how to solve. As far as I understood you have a file that contains typescript and CSSX inside and:
Pehaps
The third option is more likely to be done but still requires knowledge of TypeScript and digging deeper in CSSX transpilation.
What you think?
What about also supporting template strings? So instead of
let style = <style>
input {
color: red;
}
<style>
we can write
let style = cssx`
input {
color: red;
}
`
and CSSX can transpile that (with optional leaving it as is and it would work at runtime too)?
The template string version would actually be very very nice, because I am using this plugin to syntax highlight template strings in any language (including CSS): https://github.com/Quramy/vim-js-pretty-template
And TypeScript understands template strings, so no problem; I can run CSSX transpiler after TypeScript. Well, I would have to make sure that TypeScript doesn't transpile the template strings to normal strings.
I guess it would be easy to modify TypeScript to ignore template strings at that point.
Ah nice idea. Template string support is doable. I'll think about it. I didn't touch the transpiler for months so it may take some time. Sorry.
No worries, just using JS object literals for now.
I was trying to use this with TypeScript, but it fails. Trying to compile with TypeScript first fails with SyntaxErrors too.
Example webpack.config.js:
One problem, for example, is with a file that has this in it:
Seems that CSSX doesn't know what to do with that TypeScript-style export.