Skip to content

Allow package.json customisation when using svelte-package #7258

Closed
@tkvw

Description

@tkvw

Describe the problem

I'm always frustrated when svelte-package creates a package.json not to my liking.
In a monorepo I have specified the following two entries in the original package.json to allow a component library to work with the svelte-kit generated website:

  "svelte": "src/lib/index.ts",
  "types": "src/lib/index.ts",

This is shamefully copied by the svelte-package library.

Describe the proposed solution

Allow packageJson generation to be overwritten in the package config section of svelte.config.js.

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: preprocess(),
  kit: {
    adapter: adapter()	
  },
  package: {
	mergePackageJson: (original,proposed) => proposed // default = proposed, false = skip 
  }
};

Alternatives considered

Post edit the generated package.json

Importance

would make my life easier

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions