sveltejs / sveltejs/cli

feat: Make `@sveltejs/sv-utils` browser-friendly

Open
#1,262 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
506
Forks
107
Avg merge
5d 15h
Merged PRs (30d)
28

Description

I would like to reuse the same logic based on @sveltejs/sv-utils both in the implementation of an addon and in factories that generate files for sandbox environments directly in the browser.

Currently, this is not possible because the Node.js version of the yaml dependency is bundled. As a result, the generated bundle contains the following import:

import { createRequire } from "node:module";

Would it be possible to use a browser-compatible version/build of yaml instead, so that @sveltejs/sv-utils can also be used in browser environments?

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 locating the @sveltejs/sv-utils package configuration and its yaml dependency or bundling setup. Check how the browser bundle is generated, then verify that the resulting bundle no longer imports node:module and can be used in a browser environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, yaml
Domain
tooling, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.