Skip to content

Library output is not tree-shakeable #39

@luckylooke

Description

@luckylooke

I have just tested tree shaking and it seems to be not working.

Reproduction:

  1. init fresh library
npx vue-sfc-rollup sfc-init
  1. create duplicate of sample component.. called example
  2. build
npm run build
  1. In Vue app project
import { WsUikitSample } from 'your-lib';
...
components: {
    WsUikitSample,
  },
...
  1. build app for production
  2. WsUikitExample is present in bundle :/

I thought it will be fixed by removing all from entry.ts but following line

export * from '@/lib-components/index';

it did not help
I am still getting Example component implementation into app bundle, even the app does not use it. :/

I did upload example library https://github.com/luckylooke/vue-sfc-rollup-tree-shake
I did not upload app as i ti standard Vue app generated by Vue CLI
So I did not publish full reproduction... I can do it later, but I need to know first whether there wont be answer like: "Tree shake is not supported", so I spare some energy to reproduce it online..
thanks for understanding

And also thanks for sharing this repo.. so far the best I have found but still missing this tree shake feature.

Happy coding 🙂 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions