feat: css source map support

オープン
#6,964 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Elements2720 がすでに取り組んでいます。

2026年10月20日 から。

  • #6969 @Elements2720 による — オープン

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
css, typescript

調査の方向性

Start by tracing the existing sourceMap option through the build and development pipelines, then inspect how CSS is passed to plugins such as @stencil/sass and through the minifyCss option. The issue proposes extending the option and carrying maps into runtime style tags, including style modes, but names no files or tests. Done means CSS maps work in build and development and can be used by browser developer tools.

索引モデルが issue の本文から書いたものです。

説明

Feature: Want this? Upvote it!
Prerequisites
Describe the Feature Request

Add native support for generating CSS source maps during the build and development processes.
Currently, Stencil supports JavaScript/TypeScript source maps, but lacks built-in generation for CSS source maps. This makes it difficult to trace compiled styles back to their original source files within the browser's developer tools.

Describe the Use Case

When developing large-scale design systems with Stencil, styles are often written using complex Sass/PostCSS setups or split across multiple utility files.

CSS source maps will allow developers to inspect an element and see the exact source file, improving the developer experience.

In addition coverage for CSS can be generated and mapped back to the responsible file.

Describe Preferred Solution

the current sourceMap option could be extended:

type SourceMapOption = boolean | {
  css?: boolean,
  js?: boolean,
}

This option must then be pass to plugins like @stencil/sass.

The internal minifier (minifyCss option) must also chain the source map.


to avoid any source map reference comment in the code which could interfere with normal source maps the output component could be extended:

const myComponentCss = () => ``;

const MyComponent = class {};
MyComponent.style = myComponentCss();

MyComponent.sourceMap = 'path to source map or inline source map'; 

the runtime can then inject both the style and sourceMap to the style tag.

to also support style modes the souceMap property can also be an object matching the name of the currently mounted style

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

主要言語
TypeScript
スター
13.2k
フォーク
870
平均マージ
2日 54分
マージ済み PR(30日)
50

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

stenciljs/core のほかの issue

stenciljs/core の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。