Skip to content

Implement tree-shaking #503

@alansemenov

Description

@alansemenov

Configure tree shaking of TS files in the build so that only imported properties get transpiled rather than entire packages.

Example of importing date-fns:
https://github.com/statisticsnorway/mimir/blob/master/src/main/resources/lib/ssb/utils/dateUtils.ts#L1

This currently transpiles the entire date-fns package instead of only enGB, nb, nn.

Another issue is that internal imports don't seem to be replaced by require.
This local import (./dateUtils) is currently inlined on transpilation in all its entirety:
https://github.com/statisticsnorway/mimir/blob/master/src/main/resources/lib/ssb/utils/articleUtils.ts#L9

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