Skip to content

Unable to load CSS in component #24

@KirilNN

Description

@KirilNN

We are trying to load a CSS file into the HelloWorld component using:

@Component({
  selector: 'hello-world-app',
  templateUrl: 'hello-world.template.html',
  styleUrls: ['hello.css'],
  encapsulation: ViewEncapsulation.None
})

this throws with You may need an appropriate loader to handle this file type.

Tried adding css-loader and style-loader in the webpack.config.js file:

{ test: /\.css$/, use: ["style-loader", "css-loader"]},

but this triggers an Angular exception Cannot read property 'replace' of undefined.

Any help will be appreciated!

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