pirxpilot / stylus-font-face

bulletproof @font-face in stylus
14 stars 12 forks source link

sourcemaps #10

Open lewisacidic opened 8 years ago

lewisacidic commented 8 years ago

Hi,

Nice plugin - however I am having a problem with source maps compatibility when I'm using inlining with gulp... I'm not sure why but I get something like this:.

$ gulp styles
[17:08:18] Requiring external module babel-core/register
[17:08:26] Using gulpfile ~/git/richlew.is/gulpfile.babel.js
[17:08:26] Starting 'styles'...
Potentially unhandled rejection [2] TypeError: /Users/rich/git/richlew.is/src/_settings.styl:7:1
   3| font-face-inline('Source Sans Pro', 'Source-Sans-Pro-200', '../fonts/Source-Sans-Pro-200', 200)
   4| 

------^

Path must be a string. Received undefined

    at assertPath (path.js:8:11)
    at posix.relative (path.js:494:3)
    at SourceMapper.normalizePath (/Users/rich/git/richlew.is/node_modules/gulp-stylus/node_modules/stylus/lib/visitor/sourcemapper.js:149:10)
    at SourceMapper.visitLiteral (/Users/rich/git/richlew.is/node_modules/gulp-stylus/node_modules/stylus/lib/visitor/sourcemapper.js:164:23)
    at SourceMapper.Visitor.visit (/Users/rich/git/richlew.is/node_modules/gulp-stylus/node_modules/stylus/lib/visitor/index.js:28:40)
    at /Users/rich/git/richlew.is/node_modules/gulp-stylus/node_modules/stylus/lib/visitor/compiler.js:502:58
    at Array.map (native)
    at SourceMapper.Compiler.visitExpression (/Users/rich/git/richlew.is/node_modules/gulp-stylus/node_modules/stylus/lib/visitor/compiler.js:502:26)
    at SourceMapper.Visitor.visit (/Users/rich/git/richlew.is/node_modules/gulp-stylus/node_modules/stylus/lib/visitor/index.js:28:40)
    at /Users/rich/git/richlew.is/node_modules/gulp-stylus/node_modules/stylus/lib/visitor/compiler.js:502:58

Any ideas? It's not that bad, I just like the idea of inlining!

Thanks!

pirxpilot commented 8 years ago

Sorry, no idea what's going on here: I am not a regular user of either babel or gulp ;-) Also many things changed since this was initially written and inlining fonts (especially inlining large font files) is more and more an anti-pattern. That said: if anyone figures what the problem is I'll gladly take a patch.