Skip to content

Sass pkg: URLs #5

@polarbirke

Description

@polarbirke

No longer will you have to manually add node_modules to your loadPaths option and worry about whether nested packages will work at all. No longer will you need to add ~s to your URLs and give up all portability. Now you can just pass importers: [new NodePackageImporter()] and write @use 'pkg:library' and it’ll work just how you want out of the box.
(Offizieller Blogpost, Docs)

Vorher:

/* File: ./src/styles/index.scss */
@import '../../node_modules/bootstrap/scss/bootstrap';

Nachher:

/* File: ./src/styles/index.scss */
@import 'pkg:bootstrap';

Anforderungen

  • sass bzw. sass-embedded ab Version 1.71 (kein node-sass!)
  • der Buildprozess muss sass.compile() nutzen statt der legacy JS API mit sass.render()

Buildtools, die die Anforderungen erfüllen

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