wix-incubator / stylable-integration

Integrating Stylable into your project
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Load Mixin files with TS-Loader #22

Closed tomrav closed 6 years ago

tomrav commented 6 years ago

Allows writing Mixin files in TypeScript instead of JavaScript.

lbelinsk commented 6 years ago

I have just stumbled this issue where I wanted to write a Mixin in ts. Since it is not supported, I wrote the Mixin in .js but then it was ignored so I couldn't find it in the dist folder.

The tmp hack which I did for now: https://github.com/wix-private/wix-ui-adi/pull/38

Whenever that will be supported, I would prefer to drop this local hack and change the Mixin to be written in .ts.

Thanks

barak007 commented 6 years ago

In order to load ts files in stylable plugin you can add this in the webpack.config.js

require("ts-node").register({ /* options */ });
lbelinsk commented 6 years ago

@barak007 can you elaborate please? I am not sure what I need to do in order to write a mixin file in ts. Maybe a link to some example?