Closed tomdye closed 7 years ago
Initial work has been carried out to create a typescript pre-loader that parses the typescript and looks for .css
imports before generating the appropriate .d.ts
files.
This works correctly for the first run / dojo build
usage but does not re-compile when a .css
file is edited in watch
mode.
I tried using addDependency
to make the ts
files dependent on the .css.d.ts
files they generated and also made the .css
files themselves dependent on the .css.d.ts
files but this causes a cyclical build issue where it rebuilds indefinitely.
Current code is pushed upto a branch: https://github.com/tomdye/cli-build/tree/dts-preloader
Diff can be seen here: https://github.com/dojo/cli-build/compare/master...tomdye:dts-preloader
css-module-typings
should be created as part of our webpack build process. Furthermore they should be included in the watch process such that they are generated as they are edited. An attempt was made to usetyped-css-module-loader
but this was not sufficient. There are outstanding PR's and issues on this loader which may provide a solution but it's likely that we may need to create atypescript
pre-loader which plucks out the.css
imports and creates the appropriate typings.