title: Import css files in typescript-files using aliases, webpack
body: <p>i set up a project using webpack, react and typescript. I am now trying to use aliases for imports, which works fine for the most part.
  However, i can't make importing css files to work with aliases.</p>
  <p>I added the following part to my <code>webpack.config.json</code></p>
  <pre><code>...
      resolve: {
          extensions: [&quot;&quot;, &quot;.ts&quot;, &quot;.tsx&quot;, &quot;.js&quot;, &quot;.json&quot;, &quot;css&quot;, &quot;.scss&quot;],
          alias: {
              BaseComponents: path.resolve(__dirname, &quot;src&quot;, &quot;BaseComponents&quot;),
              Pages: path.resolve(__dirname, &quot;src&quot;, &quot;Pages&quot;),
              Styles: path.resolve(__dirname, &quot;src&quot;, &quot;Styles&quot;),
          },
      },
      module: {
          rules: [
              {
                  test: /\.(ts|tsx)$/,
                  loader: &quot;babel-loader&quot;,
                  exclude: /node_modules/,
              },
              {
                  test: /\.(css)$/,
                  use: [&quot;style-loader&quot;, &quot;css-loader&quot;],
              },
          ],
      },
  
  ...
  </code></pre>
  <p>and the following part to the <code>tsconfig.json</code></p>
  <pre><code>...
      &quot;paths&quot;: {
              &quot;BaseComponents/*&quot;: [&quot;./src/BaseComponents/*&quot;],
              &quot;Pages/*&quot;: [&quot;./src/Pages/*&quot;],
              &quot;Styles/*&quot;: [&quot;./src/Styles/*&quot;],
       },
  ...
  </code></pre>
  <p>Importing other react components and normal functions works as expected.</p>
  <p>When i write</p>
  <pre><code>import &quot;../Styles/test.css&quot;;
  </code></pre>
  <p>it works fine. But using the alias</p>
  <pre><code>import &quot;Styles/test.css&quot;;
  </code></pre>
  <p>doesn't work, even though the ide doesn't complain and intellisense works when typing in the path.</p>
  <p>The error is
  <code>ERROR in ./src/BaseComponents/App.tsx 3:0-25 Module not found: Error: Can't resolve 'Styles/test.css'</code></p>
  <p>Does anyone know how to solve this?</p>
  <p>Thank you.</p>