Closed hiyelbaz closed 4 years ago
tsify works by compiling the content of the files from disk and then feeding the complied code back to Browserify. That means there is no mechanism for manipulating content with other Browserify plugins or transforms before tsify.
This also means that if the source cannot be compiled using tsc - the command-line compiler - it cannot be complied with tsify either. And I doubt there is a mechanism to compile CSS imports with tsc.
I no longer use tsify, but IIRC, I used require
calls to import Angular templates - in the early days, before Angular had a CLI - you should be able to do the same with your CSS. If you use require("./styles.css")
in your source, it should compile fine and Browserify can then handle doing whatever it is you want to do with the CSS.
I tried required
and worked well. Thank you for quick response.
A ts file containing
import "./styles.css"
statement gets transpiled intorequire("./styles.css")
when using tsc command. As far as I understand, tsify is trying to transpile css files into js statements and it breaks the browserify pipeline. How can I make css files get handled by other plugins?