Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Css not getting imported #195

Open
Open
@soerenmeier

Description

@soerenmeier

Describe the bug

Today i ran into a weird behaviour, which took a few minutes to debug, my folder structure:

  • keyboard.svelte
  • keyboard.js
  • keyboard.css

Where the js file is a custom dom component which is styled in keyboard.css, then everything is nicely packed into a svelte component in keyboard.svelte.
but importing the style with import './keyboard.css'; in keyboard.svelte or keyboard.js did nothing. After digging around a bit i found that svelte gives the css/styles inside keyboard.svelte the id: './keyboard.css' (in the plugin transform call). rollup-plugin-css-only then skip's my file keyboard.css entirely. After renaming it everything works as expected.
Would be nice if svelte would rename the id if a file already exists with that name or at least show a warning.

Reproduction

Create a svelte component and a css file with the same name for example:

  • component.svelte
  • component.css

Then import the css in component.svelte.

Logs

No warning or error.

System Info

System:    OS: Linux 5.13 Ubuntu 20.04.3 LTS (Focal Fossa)    CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz    Memory: 18.93 GB / 31.27 GB    Container: Yes    Shell: 5.0.17 - /bin/bash  Binaries:    Node: 17.3.1 - /usr/bin/node    npm: 8.3.0 - /usr/bin/npm  Browsers:    Chromium: 98.0.4758.80    Firefox: 96.0  npmPackages:    rollup: ^2.3.4 => 2.66.1     svelte: ^3.0.0 => 3.46.3

Severity

annoyance

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp