Skip to content

Plugin template wrong package.json configuration #13426

@VeiaG

Description

@VeiaG

Describe the Bug

https://github.com/payloadcms/payload/blob/main/templates/plugin/package.json

Default exports pointing to non-existing index file in exports folder.

"exports": {
    ".": {
      "import": "./src/exports/index.ts",
      "types": "./src/exports/index.ts",
      "default": "./src/exports/index.ts"
    },

And on publish too

"publishConfig": {
    "exports": {
      ".": {
        "import": "./dist/exports/index.js",
        "types": "./dist/exports/index.d.ts",
        "default": "./dist/exports/index.js"
      },

Link to the code that reproduces this issue

https://github.com/payloadcms/payload/blob/main/templates/plugin/package.json

Reproduction Steps

Try to publish sample plugin and import it in code.

Which area(s) are affected? (Select all that apply)

area: templates

Environment Info

Latest template

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions