Open vitaliy-du opened 5 years ago
Can you please provide some more detail? What command were you running?
atsm sources -p */.sass -o types
In global.sass file i have @import "~bourbon/core/bourbon"
, its without alias, import bourbon.scss from node_modules. And then i see a message File to import not found or unreadable: ~bourbon/core/bourbon
Also i use aliases for import @import "/sources/core/bourbon"
where /sources
is alias for specify absolute path for import.
Yeah, I'm getting an error when using this on scss files with @import statements with ~ prefix.
File to import not found or unreadable
It appears ~ prefix is not part of the sass spec, but something sass-loader added to work with webpack. This tool is only intended to support standard sass features, so I don't think ~ prefix is going to be supported.
https://github.com/webpack-contrib/sass-loader#imports, in that case your tool is not fully support sass, and have seriously restriction.
I don't think it's fair to say the tool doesn't fully support sass since ~ is not part of the sass standard. It's a webpack specific thing and depends on webpack resolving engine AFAIK.
This tool delegated all sass related functionalities (parsing, import resolution) to node-sass. and I think they fully support sass.
That being said, I found an API in node-sass that allows you to plug in your own import resolution logic. And there is already a npm module that provides this logic (https://www.npmjs.com/package/node-sass-tilde-importer). You can take a look at it and see if it works for you. PR is welcomed. Otherwise I will take a look in a few days when I get time.
Released 1.2.0 with ~ import support. Can you please try the new version?
Path with .extension @ import "~bourbon/core/bourbon.scss" is worked, without extension @ import "~bourbon/core/bourbon" Error: File to import not found or unreadable: .../node_modules/bourbon/core/bourbon/index. The @ import from root or relative not worked too.
File to import not found or unreadable: ~bourbon/core/bourbon.
/sources is alias Error: File to import not found or unreadable: /sources/sass/global.