Closed cwygoda closed 8 years ago
Definitely in the ignoreFiles code. I didn't realise it was possible for a file to not have a source. Maybe that's the bug, it could be either...
All nodes should have an input (except where they're being created manually).
How are you running doiuse?
This is definitely all file based sources. My processors definitions is
var processors = [
at_import,
suit,
precss({
import: { disable: true },
mixins: {
mixins: {
'font-face': font_face
}
}
}),
autoprefixer,
doiuse({
browsers: [
'ie >= 10',
'> 10%'
],
ignore: [
'rem'
],
ignoreFiles: [
'**/normalize.css'
]
})
];
The actual code is though gulp-postcss:
return gulp.src(src, {
base: base
})
.pipe(sourcemaps.init())
.pipe(postcss(processors))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(dest));
It's possible that one of the plugins are being naughty when creating their atRule command. Could you try disabling plugins one at a time, and see if doiuse still gets upset?
If the issue is one of your plugins, I'm torn on the solution. On one hand, maybe we should expect broken input from other plugins, or maybe we should stand ground and force them to fix themselves.
Oh, I have a bad feeling this might my diy font-face mixin. I'll check and hope it's only me to blame. I'll let you know if I wasted your time.
https://github.com/postcss/postcss/blob/master/docs/api.md#nodesource
For any use it may be <3
Oh my, what can I say? My fault. Didn't copy the source from the mixin to it's result. Best thing is I learned something, worst thing is I wasted your time.
I'm glad you figured it out. I don't mind at all, it's interesting to see what can break things!
Using ignoreFiles i get a crash with an atRule. Here's the usage object at https://github.com/anandthakker/doiuse/blob/v2.2.1/src/doiuse.js#L29 just before the crash:
and here's the shortened traceback:
Here's my doiuse config:
I am not sure if this is an bug with the atRule object or the ignoreFiles code.