feat: css source map support

Abierto
#6,964 0 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@Elements2720 ya está trabajando en esto.

Desde el 20/10/2026.

  • #6969 de @Elements2720 — abierto

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
css, typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
13.2k
Forks
870
Merge medio
2 d 54 min
PR fusionados (30 d)
50

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de stenciljs/core

Todos los issues de stenciljs/core

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.