sveltejs / sveltejs/kit

`svelte-package` without a build step

Open
#14,962 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation pkg:svelte-package
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the problem

I have a monorepo in which I have /packages and /sites.

The sites use the local (workspace) packages.

Therefore, I have to build the package every time it is updated:

"build:viewer": "pnpm --dir ../../packages/viewer package",
Describe the proposed solution

Would it be possible to have a no-build configuration?

I would love to import files directly from the lib directory:

- /packages/viewer/dist
+ /packages/viewer/src/lib

If the consumer has a TypeScript supported environment, they could use the .ts files without transpiling it.

Alternatives considered

If no build step can be achieved without svelte-package, the CLI could provide this as a separate template. (which is probably needed due to the changes in the package.json file)

Importance

nice to have

Additional Information

Marked as off-topic here: https://github.com/sveltejs/cli/issues/783#issuecomment-3561438532

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the svelte-package command and the package.json changes involved in publishing a package. Check how the proposed /packages/viewer/src/lib entry differs from /packages/viewer/dist and determine what a no-build configuration would need to support. Done means a workspace package can be consumed directly from its source without running the package build step.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.