You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I writed simple plugin for gulp, which parses every file to do something with, then stringifies it back. The problem is that when the plugin comes across an empty css source in sourcemap, it does not write it to new sourcemap.
For example, i have 3 files: main.css, addon.css, empty.css. And the last one empty. I also concats all files in one style.css file before pass through my plugin. Here's some code from my plugin:
return through.obj(function(file, enc, next) {
if (file.isNull()) {
next(null, file);
return;
}
const ast = css.parse(file.contents + '', {source: file.relative});
// Here's some plugin logic
// If I remove this part, nothing will change
ast.stylesheet.rules = main(ast.stylesheet.rules);
const result = css.stringify(ast, {sourcemap: !!file.sourceMap});
file.contents = new Buffer(result.code);
if (file.sourceMap) {
result.map.file = file.relative;
applySourceMap(file, result.map);
}
this.push(file);
next();
});
In the output sourcemap empty.css just doesn't exists. And maybe it's ok, because i don't really need empty files in sourcemap, but parser do the same with files, that just don't have css code. I using sass, and have files that only contains mixins, functions, etc.. For example:
So i have sources in sourcemap like [main.sass, <here's must be some-mixnin.sass, but it's doesn't>, addon.sass]. Another problem is, when i use another plugin after mine, for example clean-css, i've got something like this: [main.sass, style.css, addon.sass], where style.css is my output file (and sourcesContents for style.css is null).
Tell me if i do something wrong. But i think it's just bug in parser.
The text was updated successfully, but these errors were encountered:
I writed simple plugin for gulp, which parses every file to do something with, then stringifies it back. The problem is that when the plugin comes across an empty css source in sourcemap, it does not write it to new sourcemap.
For example, i have 3 files: main.css, addon.css, empty.css. And the last one empty. I also concats all files in one style.css file before pass through my plugin. Here's some code from my plugin:
In the output sourcemap empty.css just doesn't exists. And maybe it's ok, because i don't really need empty files in sourcemap, but parser do the same with files, that just don't have css code. I using sass, and have files that only contains mixins, functions, etc.. For example:
So i have sources in sourcemap like [main.sass, <here's must be some-mixnin.sass, but it's doesn't>, addon.sass]. Another problem is, when i use another plugin after mine, for example clean-css, i've got something like this: [main.sass, style.css, addon.sass], where style.css is my output file (and sourcesContents for style.css is null).
Tell me if i do something wrong. But i think it's just bug in parser.
The text was updated successfully, but these errors were encountered: