reworkcss / rework-npm

Import CSS from npm modules using rework
BSD 2-Clause "Simplified" License
87 stars 19 forks source link

Use filename information from AST #10

Closed conradz closed 10 years ago

conradz commented 10 years ago

We should be able to get the source filename information from the AST, which should allow us to drop the dir parameter (simply using the directory of the file specified by position.source in the AST nodes). The source information is added by css-parse when position tracking is enabled (will default to on in the upcoming v2).

The source filename from the AST could be resolved to the root parameter. I think this would make the most sense, although we could always resolve to current directory and then make all source map filenames relative to root. Any preferences?

conradz commented 10 years ago

Fixed in 41c3c0f, removed dir option. Instead, it always uses the position.source from the AST, relative to the root option.