Skip to content

The Generated javascript file from flowbite-svelte is bigger than the generated js file from flowbite #254

@Abdulrhman311

Description

@Abdulrhman311

The Generated javascript file from flowbite-svelte is 74kb
in the other hand the generated file from flowbite is almost 3.5kb
so why the output from flowbite-svelte is very bigger than flowbite

output size
Screenshot from 2022-10-02 20-27-05

ROLLUP Config File


require('dotenv').config();
const { getRollupConfig } = require('@elderjs/elderjs');
const svelteConfig = require('./svelte.config');
module.exports = [...getRollupConfig({ svelteConfig
})];
  

Navbar.svelte

<script>
  
  import  Navbar from "../components/navbar/Navbar.svelte";
  import NavBrand from "../components/navbar/NavBrand.svelte";
  import   NavLi from "../components/navbar/NavLi.svelte";
  import  NavUl  from "../components/navbar/NavUl.svelte";
  import  NavHamburger  from "../components/navbar/NavHamburger.svelte";

</script>

<Navbar let:hidden let:toggle>
  <NavBrand href="/">
    <img
      src="https://flowbite.com/docs/images/logo.svg"
      class="mr-3 h-6 sm:h-9"
      alt="Flowbite Logo"
    />
    <span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white">
      Flowbite
    </span>
  </NavBrand>
  <NavHamburger  on:click={toggle} />
  <NavUl   {hidden}>
    <NavLi href="/" active={true}>Home</NavLi>
    <NavLi href="/">About</NavLi>
    <NavLi href="/">Services</NavLi>
    <NavLi href="/">Pricing</NavLi>
    <NavLi href="/">Contact</NavLi>
  </NavUl>
</Navbar>

svelte.config.js

const sveltePreprocess = require('svelte-preprocess');
const { terser } = require('rollup-plugin-terser');
const production = process.NODE_ENV === 'production';
module.exports = {



  preprocess: [
    sveltePreprocess({
      sourceMap: !production,
      postcss: { 
        whitelistPatterns: [/svelte-/],
        plugins: [require('tailwindcss'), require('autoprefixer'),

      
      ],

      },
      dev: !production,
    }),

  ],
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions