Skip to content

Resolving module path when @import #117

Closed
@CrlsMrls

Description

@CrlsMrls

The documentation on css-loader says @import and url(...) are interpreted like require() and will be resolved by the css-loader. But I have an error when doing an @import.

This case fails:

@import "font-awesome/css/font-awesome.css";

ERROR in ./~/css-loader!./src/app/main.css
Module not found: Error: Cannot resolve 'file' or 'directory' ./font-awesome/css/font-awesome.css

But this works

require("font-awesome/css/font-awesome.css");

I can't change it though, since this import is in a npm-managed package.

So does @import resolve module paths also? Is this related with #31?

I am using directly css-loader (and then style-loader) like in the Example config

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions