Hide playlist

    Import CSS Modules with TypeScript and webpack

    If you try to use CSS Modules in TypeScript the same way you would use them in JavaScript, with webpack’s css-loader, you’ll see an error: ”TS2307: Cannot find module './styles.css'”. typings-for-css-modules-loader is a drop-in replacement for css-loader that works with TypeScript and generates typings for CSS on the fly.

    You’ll need to install dependencies first:

    npm install --save-dev css-loader typings-for-css-modules-loader
    Please take a moment to tell your friends:

    You must be a PRO Member to view code