0

Migrating to Webpack I had some issues with import sass or css.

I have Bootstrap installed in my node_modules and inside my file structure I' trying to do this:

// folder scss
- vendor
   - bootstrap
   - pickadate
- views
- components
- base

Inside the bootstrap scss, I have the import for bootstrap files and since the path is big, I'm trying to use a variable to reuse:

$path: '../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/';
@import '#{$path}variables';
@import '#{$path}grid';
@import '#{$path}responsive-utilities';

With the code above I'm getting this error:

Module build failed:
@import '#{$path}';
^
      File to import not found or unreadable: #{$path}.

Anyone knows why?

Thanks :)

Italo Borges
  • 2,355
  • 5
  • 34
  • 45

1 Answers1

2

Possible duplicate: Import path using variable SASS

Interpolation in @import urls is not support.

Additionally, you could import like so:

@import '~bootstrap-sass/assets/stylesheets/bootstrap/variables';
sgraham
  • 143
  • 8