Skip to content

emitCss broken in v2 #56

Closed
Closed
@Rich-Harris

Description

@Rich-Harris

The ast.hash property was removed in v2, as we thought it wasn't being used anywhere (initially it was used for scoping styles, but then the scoping hash was generated from just the CSS rather than the entire component).

Turns out it was being used in svelte-loader, to provide a filename for the temporary CSS file. So now we have a bundle of different components importing svelte-undefined.css, with predictable results — only one file matches that path.

A temporary workaround is to disable emitCss.

The easy fix would be to reinstate ast.hash, or (better) compute it here. But it would be nice to have a fix that also covered #45, which probably means writing the CSS files back into the source directory:

src
  .App.css
  .Thing.css
  App.html
  Thing.html

I don't know if there's a way to clean up those files after webpack is done with them (or create them in some 'virtual' form so they don't clutter the filesystem in the first place?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions