@sveltejs/package Allow disabling the default behavior of copying package.json to the output directory when packaging a Svelte library#6825
Conversation
🦋 Changeset detectedLatest commit: bdbbb6e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@sveltejs/package Allow disabling the default behavior of copying package.json to the output directory when packaging a Svelte library
|
The package command also copied the readme and changelog. What about a more general solution like an array of files and folders to copy or a filter function? |
|
Yes that could be a more general solution. I'm tempted to put this into |
|
I didn't notice the README or changelog because it wasn't affecting the monorepo, but perhaps a more general We can make its API similar to |
|
Closed this in favor of #6864. |
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
This resolves #6824.
For context, I'm building a cross-framework component library so I've set up a standard package structure for each framework in my monorepo with npm workspaces.
I'm using Vite with
@sveltejs/packageto develop and build my components. However,@sveltejs/packagebreaks my toolchain because it creates a copy ofpackage.jsonin mydistfolder.npm workspaces picks up both the original
package.jsonanddist/package.json, causing other dependent packages to break due to the duplication.This PR adds a
copyPackageJsonoption to allow disabling the copy feature.Tests
pnpm testand lint the project withpnpm lintandpnpm checkAll existing tests for
@sveltejs/packagepass and I added a test for the new config option.Changesets
pnpm changesetand following the prompts. All changesets should bepatchuntil SvelteKit 1.0