dlmanning / gulp-sass

SASS plugin for gulp
MIT License
1.56k stars 381 forks source link

Can't find stylesheet to import in monorepo #843

Closed JeromeLin closed 2 years ago

JeromeLin commented 2 years ago

I have a monorepo project,using @import to import a module URL, have some error when scss compiling

scss file

@import '@zarm-design/bem/sass';

gulpfile.js

import dartSass from 'sass';
import gulpSass from 'gulp-sass';

const sass = gulpSass(dartSass);

  gulp.task('sass', () => {
    return gulp
      .src(DIR.sass)
      .pipe(
        sass({
          includePaths: ['node_modules'],
        }).on('error', sass.logError),
      )
      .pipe(gulp.dest(outDir));
  });

error

Error in plugin "sass"
Message:
    src/style/core/mixins/index.scss
Error: Can't find stylesheet to import.
  ╷
1 │ @import '@zarm-design/bem/sass';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^
xzyfer commented 2 years ago

Gulp sass simply passes the sass options to the sass engine. Double check you're includePaths is correct.