Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-sass-chokidar does not work with @import "~@name/theme/scss_file" #110

Open
lebaphi opened this issue May 22, 2021 · 0 comments
Open

Comments

@lebaphi
Copy link

lebaphi commented May 22, 2021

  • My project is a monorepo that has structure:
   name
   -node_modules
      -@name/theme
      -@name/client
   -packages
     -client
        -node_modules
        -src
          -style.module.scss
     -theme
       -node_modules
       -src
          -_variables.scss
  • I have a _variables.scss in themes package.

  • I import this file in the client package > style.module.scss

@import "~@name/themes/src/variables";

.class-a{
   property: $var
}

  • I add the watch:
    "watch:style": "node-sass-chokidar --include-path ../../node_modules ./src -o ./build --watch --recursive --ext scss", when I change style.module.scss, it shows an erorr:
{
  "status": 1,
  "file": ".../name/packages/client/src/styles.module.scss",
  "line": 1,
  "column": 1,
  "message": "File to import not found or unreadable: ~@name/theme/src/variables",
  "formatted": "Error: File to import not found or unreadable: ~@name/theme/src/variables.\n ........"
}

remove the ~ will make the watch runs success but it makes the build failed because the import in style.module.scss does not find the @name/themes in current node_modules, it should find in the root node_modules by adding ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant