question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sass import from node_modules not working

See original GitHub issue

Trying to import some scss-files in from the bootstrap node_module in my vue-library, e.g:

<style lang="scss" scoped> @import '~bootstrap/scss/_buttons'; </style>

This is not working, found out it’s most likely due to this issue: https://github.com/differui/rollup-plugin-sass/issues/38

Wondering if it’s possible to get the default sass-config to include the ‘~’ alias by default (to match the app code written with Poi). Everything is working so good it feels bad to add a config-file just for this issue, that’s probably pretty common 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
egoistcommented, Feb 26, 2018

This feature landed in rollup-plugin-postcss@1.3.0, re-install bili and you will receive the updates.

0reactions
timothyerwincommented, May 4, 2018

I was able to solve it by just using:

@import "node_modules/bootstrap/scss/bootstrap";

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to import from "node_modules" in sass file #727 - GitHub
I have installed bourbon library through npm, but it's not working when I import it in my stylesheet app.scss @import "bourbon"; How can...
Read more >
Importing Sass through npm - node.js - Stack Overflow
Since node_modules/npm-module-name/style.scss exists, this will be imported. @import "npm-module-name"; // Since just-a-sass-file isn't an installed npm ...
Read more >
Import a SCSS files from Node Modules - Laracasts
Hi, I'm trying to load some styles from the node_modules folder. But it's a real pain to do so. Usually, when I'm not...
Read more >
Sass @use (NOT @import) with node_modules paths - Reddit
I'm using Webpack and Dart Sass, and it seems that the traditional ~ (tilde) shortcut to node_modules does not work with \@use.
Read more >
sass-loader - webpack - JS.ORG
Node Sass does not work with Yarn PnP feature and doesn't support @use rule. Warning ... then the loader will try to resolve...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found