Skip to content

Support bundle with treeshaking #381

Open
@thisconnect

Description

@thisconnect

I just got bitten by that this library needs treeshake disabled

treeshake: false,

Rollup seems to treeshake too much away, is this a rollup bug?

The commit where treeshaking was disabled is in
33878b5#diff-527d3af57329b4d70ddb9b2ee335f0cb

But it is unclear which code is affected, commit messages mentions
"disable tree shaking as it removes placeholder functions"

import * as FilePond from 'filepond'
import FilePondPluginFileValidateSize from 'filepond-plugin-file-validate-size'
import FilePondPluginImageExifOrientation from 'filepond-plugin-image-exif-orientation'
import FilePondPluginImagePreview from 'filepond-plugin-image-preview'

FilePond.registerPlugin(
    FilePondPluginFileValidateSize,
    FilePondPluginImageExifOrientation,
    FilePondPluginImagePreview
)

FilePond.setOptions({
    maxFileSize: '5MB',
    server: 'api/'
})

var pond = FilePond.create(document.querySelector('input[type="file"]'))

Summary

Could you provide more details on why treeshaking needs to be disabled?

Consider opening a rollup issue.

How to reproduce

rollup a bundle that imports filepond

Expected behaviour

the bundle should work, i.e. the example code

Additional information

[email protected]

  • @babel/preset-env
Environment Version
OS MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions