title: Components style ignored after production build
body: <p>I have a Svelte application with Tailwindcss and Postcss configured.</p>
  <p>In development mode everything is working well, every styles (global one and components styles) are used and working.</p>
  <p>When I make a new production build, components styles are not used, it seems do be ignored during production build.</p>
  <p>I add some style to my component like the Svelte documentation show and this is working well during dev local env.</p>
  <pre><code>&lt;style&gt;
    div {
      height: 37px;
    }
  
    div:hover {
      height: 72px;
      border-radius: 1rem;
    }
  &lt;/style&gt;
  </code></pre>
  <p>Even when I use a dedicated style file, the css bundle is totally failing and some other css properties (from tailwindcss) are not working...</p>
  <p>I don't find inside my Rollup/Postcss configurations what seems to be wrong.</p>
  <p>Here is my <code>rollup.config.js</code></p>
  <pre class="lang-js prettyprint-override"><code>import svelte from 'rollup-plugin-svelte';
  import resolve from '@rollup/plugin-node-resolve';
  import commonjs from '@rollup/plugin-commonjs';
  import json from '@rollup/plugin-json';
  import livereload from 'rollup-plugin-livereload';
  import postcss from 'rollup-plugin-postcss';
  import { terser } from 'rollup-plugin-terser';
  import sveltePreprocess from 'svelte-preprocess';
  import svelteSVG from 'rollup-plugin-svelte-svg';
  
  const production = !process.env.ROLLUP_WATCH;
  
  function serve() {
    let started = false;
  
    return {
      writeBundle() {
        if (!started) {
          started = true;
  
          // eslint-disable-next-line global-require
          require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
            stdio: ['ignore', 'inherit', 'inherit'],
            shell: true,
          });
        }
      },
    };
  }
  
  export default {
    input: 'src/main.js',
    context: 'window',
    output: {
      sourcemap: true,
      format: 'iife',
      name: 'app',
      file: 'public/build/bundle.js',
    },
    plugins: [
      postcss({
        extract: true,
      }),
      json(),
      svelteSVG(),
      svelte({
        preprocess: sveltePreprocess({ postcss: true }),
        dev: !production,
        emitCss: true,
        css: (css) =&gt; {
          css.write('public/build/bundle.css');
        },
      }),
      resolve({
        browser: true,
        dedupe: ['svelte'],
      }),
      commonjs(),
      !production &amp;&amp; serve(),
      !production &amp;&amp; livereload('public'),
      production &amp;&amp; terser(),
    ],
    watch: {
      clearScreen: false,
    },
  };
  
  </code></pre>
  <p>Here is my <code>postcss.config.js</code></p>
  <pre class="lang-js prettyprint-override"><code>const cssnano = require('cssnano');
  const postcssColorMod = require('postcss-color-mod-function');
  const postcssPresetEnv = require('postcss-preset-env');
  const postcssImport = require('postcss-import');
  const postcssUrl = require('postcss-url');
  const purgecss = require('@fullhuman/postcss-purgecss');
  const tailwindcss = require('tailwindcss');
  const postcssFontMagician = require('postcss-font-magician');
  
  const production = !process.env.ROLLUP_WATCH;
  
  module.exports = {
    plugins: [
      postcssFontMagician({
        variants: {
          'Roboto Mono': {
            300: [],
            400: [],
            700: [],
          },
        },
        foundries: 'google',
        protocol: 'https:',
      }),
      postcssImport(),
      postcssUrl(),
      tailwindcss(),
      postcssPresetEnv({
        stage: 0,
        autoprefixer: {
          grid: false,
        },
      }),
      postcssColorMod(),
      cssnano({
        autoprefixer: false,
        preset: ['default'],
      }),
      production &amp;&amp;
        purgecss({
          content: ['./**/*.svelte'],
          defaultExtractor: (content) =&gt; content.match(/[A-Za-z0-9-_:/]+/g) || [],
        }),
    ],
  };
  </code></pre>
  <p>After hours of seeking a solution and modifying configurations I can't make it works.
  I think the purgecss function is removing my component's style without conviction.</p>
  <p>Everything seems to be OK, did I miss something?</p>
  <p><strong>EDIT</strong></p>
  <p>Even some JavaScript is not included in the final bundle. It's very weird</p>