Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To import SCSS dynamically in TypeScript, you can use the require() function with the appropriate type declaration:

declare function require(module: string): any;

Then, you can invoke the function and pass in the path to the SCSS file as a string:

const styles = require('./styles.scss');

This will load the SCSS and make it available as an object that you can use in your code.