title: Correct use of MiniCssExtractPlugin in a SSR React-TypeScript app
body: <p>I have a SSR React-TypeScript app, built on Webpack 4 and I use SCSS for each React component. I use two Webpack config files, one for the client bundle and one for the server bundle.</p>
  
  <p>I am in a bind as to how to use the MiniCssExtractPlugin to load my SCSS on the client Webpack config. The documentation isn't very helpful. It is evident that this rule is necessary inside modules:</p>
  
  <pre><code>{
      test: /\.scss$/,
      use: [
          MiniCssExtractPlugin.loader,
          "css-loader",
          "sass-loader"
      ]
  }
  </code></pre>
  
  <p>But it isn't clear what file should go here:</p>
  
  <pre><code>plugins: [
      new webpack.HotModuleReplacementPlugin(),
      new MiniCssExtractPlugin({
          filename: devMode ? '[name].css' : '[name].[hash].css',
          chunkFilename: devMode ? '[id].css' : '[id].[hash].css',
      })
  ],
  </code></pre>
  
  <p>My SCSS files are spread throughout my application: each React component has its own SCSS file. I don't know how to pass these files to MiniCssExtractPlugin.</p>
  
  <p>For the server Webpack config, I have the following to load my SCSS files and I don't know whether or not it's sufficient:</p>
  
  <pre><code>{
      test: /\.scss$/,
      use: ["css-loader", "sass-loader"]
  }
  </code></pre>
  
  <p>I would love to see an actual working example of a similar app, if possible.</p>
  
  <p>My css file as generated by MiniCSS:</p>
  
  <pre><code>.home {
    text-align: center; }
  
  .home-logo {
    animation: home-logo-spin infinite 20s linear;
    height: 40vmin;
    pointer-events: none; }
  
  .home-header {
    background-color: #282c34;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: calc(10px + 2vmin);
    color: white; }
  
  .home-link {
    color: #61dafb; }
  
  @keyframes home-logo-spin {
    from {
      transform: rotate(0deg); }
    to {
      transform: rotate(360deg); } }
  
  
  /*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvY2xpZW50L3ByZXNlbnRhdGlvbmFsLWNvbXBvbmVudHMvaG9tZS9Ib21lLnNjc3MiXSwibmFtZ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