Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support default export and UMD #301

Merged
merged 1 commit into from
Mar 27, 2023

Commits on Mar 6, 2023

  1. Support default export and UMD

    It’s possible to support both a CJS export and a `.default` property by
    defining the export as an interface that has a call expression and a
    default property. This makes it possible to use
    `import classNames from 'classnames'` or `classNames.default('')`.
    
    Also this packages exposes a UMD module, meaning `classNames` is
    available as a global when using a TypeScript script, but not when using
    a TypeScript module. This is supported by adding
    `export as namespace classNames`.
    remcohaszing committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    aa1a0fa View commit details
    Browse the repository at this point in the history