Skip to content

csp-header package is not treeshakable. #14

@alexandersorokin

Description

@alexandersorokin

I'm using the csp-header package in a browser environment to dynamically build Content Security Policies, which are then included in child iframes via meta tags.

Currently, the package only provides an CommonJS version, which prevents Vite and Rollup from tree-shaking unused code. This results in unnecessary constants being included in the final bundle.

Would you consider:

  1. Adding native ESM support (e.g., through .mjs files)?
  2. Or providing a dual CJS/ESM build (for example via the exports field or the module field in package.json)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions