Skip to content

Adding plugin breaks scss compilation for index.html #3

@steveblue

Description

@steveblue

It seems the plugin is incompatible with css preprocessors to a degree.
I am able to import scss in files just fine.

import style from './button.scss';

resolves to a string as in intended.

However, just adding this plugin has now broken global styling.

STEPS TO REPRODUCE:

yarn add parcel-plugin-css-to-string

index.html:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title Parcel Starter</title>
    <link rel="stylesheet" type="text/css" href="style/style.scss">
  </head>
  <body>
    <h1>Hello World</h1>
  </body>
</html>

style.scss

body {
    font-family: sans-serif;
    font-size: 16px;
}

Styling included with link tag fails to compile with parcel and parcel build. Otherwise, plugin works as prescribed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions