Skip to content

Support non-JS exports #31

@grant-progress

Description

@grant-progress

When building a library designed to be used in a bundler with asset importing, it's sometimes convenient to create entrypoints for particular library assets, like import 'my-lib/main.css';. I'm not sure if this is recommended, but it is perfectly doable with package.exports by simply pointing to the asset file location.

Since zshy takes over the exports field it would be nice for it to detect non-.[mc][tj]s export values and write them as-is.

Example

Given the config:

"zshy": {
  ".": "./src/index.ts",
  "./main.css": "./assets/main.css"
}

zshy writes the following:

"exports": {
  ".": {
    "types": "./dist/index.d.cts",
    "import": "./dist/index.js",
    "require": "./dist/index.cjs"
  },
  "./main.css": "./assets/main.css"
}

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