{"action":"created","issue":{"url":"https://api.github.com/repos/jonathanepollack/gulp-minify-css/issues/83","labels_url":"https://api.github.com/repos/jonathanepollack/gulp-minify-css/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/jonathanepollack/gulp-minify-css/issues/83/comments","events_url":"https://api.github.com/repos/jonathanepollack/gulp-minify-css/issues/83/events","html_url":"https://github.com/jonathanepollack/gulp-minify-css/issues/83","id":67434201,"number":83,"title":"breaking sourcemaps?","user":{"login":"rkichenama","id":1634457,"avatar_url":"https://avatars.githubusercontent.com/u/1634457?v=3","gravatar_id":"","url":"https://api.github.com/users/rkichenama","html_url":"https://github.com/rkichenama","followers_url":"https://api.github.com/users/rkichenama/followers","following_url":"https://api.github.com/users/rkichenama/following{/other_user}","gists_url":"https://api.github.com/users/rkichenama/gists{/gist_id}","starred_url":"https://api.github.com/users/rkichenama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkichenama/subscriptions","organizations_url":"https://api.github.com/users/rkichenama/orgs","repos_url":"https://api.github.com/users/rkichenama/repos","events_url":"https://api.github.com/users/rkichenama/events{/privacy}","received_events_url":"https://api.github.com/users/rkichenama/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-09T19:30:57Z","updated_at":"2015-04-10T13:29:56Z","closed_at":"2015-04-10T13:29:56Z","body":"When I attempt to concatenate files before minifying, with sourcemaps, I get an error in gulp-sourcemaps.\r\n\r\nTypeError: Cannot read property 'line' of undefined\r\n    at originalPositionIn\r\n\r\n```javascript\r\nvar \r\n    gulp = require('gulp'),\r\n    concat = require('gulp-concat'),\r\n    minifyCss = require('gulp-minify-css'),\r\n    sourcemaps = require('gulp-sourcemaps');\r\n/*\r\nbundle is an array of relative file locations\r\nname is the filename to concateenate the files to\r\npath is the destination\r\n*/\r\nfunction cssMinify(bundle, name, path) {\r\n    if(bundle.length) {\r\n        gulp.src(bundle, { base: dirs.styles })\r\n            .pipe(sourcemaps.init({loadMaps: false}))\r\n                .pipe(concat(name + '.css'))\r\n                .pipe(minifyCss())\r\n            .pipe(sourcemaps.write('./'))\r\n            .pipe(gulp.dest(path));\r\n    }\r\n}\r\n```\r\n\r\nThis error only occurs when minifyCss is in the pipe chain. Does minify-css not accept streams?"},"comment":{"url":"https://api.github.com/repos/jonathanepollack/gulp-minify-css/issues/comments/91557983","html_url":"https://github.com/jonathanepollack/gulp-minify-css/issues/83#issuecomment-91557983","issue_url":"https://api.github.com/repos/jonathanepollack/gulp-minify-css/issues/83","id":91557983,"user":{"login":"rkichenama","id":1634457,"avatar_url":"https://avatars.githubusercontent.com/u/1634457?v=3","gravatar_id":"","url":"https://api.github.com/users/rkichenama","html_url":"https://github.com/rkichenama","followers_url":"https://api.github.com/users/rkichenama/followers","following_url":"https://api.github.com/users/rkichenama/following{/other_user}","gists_url":"https://api.github.com/users/rkichenama/gists{/gist_id}","starred_url":"https://api.github.com/users/rkichenama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkichenama/subscriptions","organizations_url":"https://api.github.com/users/rkichenama/orgs","repos_url":"https://api.github.com/users/rkichenama/repos","events_url":"https://api.github.com/users/rkichenama/events{/privacy}","received_events_url":"https://api.github.com/users/rkichenama/received_events","type":"User","site_admin":false},"created_at":"2015-04-10T13:29:56Z","updated_at":"2015-04-10T13:29:56Z","body":"I found through more testing that minify-css might have been trying to create its own sourcemaps by default. I added the {sourceMaps: false} parameter to the call and was able to get the minification with no issue.\r\n\r\n```javascript\r\nfunction cssMinify(bundle, name, path) {\r\n    if(bundle.length) {\r\n        gulp.src(bundle, { base: dirs.styles })\r\n            .pipe(sourcemaps.init({loadMaps: false}))\r\n                .pipe(concat(name + '.css'))\r\n                .pipe(minifyCss({sourceMaps: false}))\r\n            .pipe(sourcemaps.write('./'))\r\n            .pipe(gulp.dest(path));\r\n    }\r\n}\r\n```"}}