{"action":"created","issue":{"url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/716","repository_url":"https://api.github.com/repos/jakubpawlowicz/clean-css","labels_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/716/labels{/name}","comments_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/716/comments","events_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/716/events","html_url":"https://github.com/jakubpawlowicz/clean-css/issues/716","id":123061228,"number":716,"title":"Prevent minified version of source maps?","user":{"login":"jaminroe","id":1559447,"avatar_url":"https://avatars.githubusercontent.com/u/1559447?v=3","gravatar_id":"","url":"https://api.github.com/users/jaminroe","html_url":"https://github.com/jaminroe","followers_url":"https://api.github.com/users/jaminroe/followers","following_url":"https://api.github.com/users/jaminroe/following{/other_user}","gists_url":"https://api.github.com/users/jaminroe/gists{/gist_id}","starred_url":"https://api.github.com/users/jaminroe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaminroe/subscriptions","organizations_url":"https://api.github.com/users/jaminroe/orgs","repos_url":"https://api.github.com/users/jaminroe/repos","events_url":"https://api.github.com/users/jaminroe/events{/privacy}","received_events_url":"https://api.github.com/users/jaminroe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":31,"created_at":"2015-12-19T04:19:35Z","updated_at":"2016-03-28T23:58:26Z","closed_at":"2015-12-27T17:43:15Z","body":"How do I prevent this plug-in from compiling a minified version of the source map? Example:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1559447/11911259/a7e6c05a-a5dd-11e5-9c82-1839f8d01cd2.png)\r\n\r\nThis is what I have in my gulpfile for this task:\r\n```\r\n// Compile Our Sass\r\ngulp.task('sass', function() {\r\n    return gulp.src('*.scss')\r\n        .pipe(sourcemaps.init())\r\n        .pipe(sass(sassOptions).on('error', sass.logError))\r\n        .pipe(autoprefixer())\r\n        .pipe(gulpIf('*.css', minifyCss()))\r\n        .pipe(rename({\r\n            suffix: '.min'\r\n        }))\r\n        .pipe(sourcemaps.write('./'))\r\n        .pipe(gulp.dest('./'));\r\n});\r\n```\r\n\r\nIf I just do: `.pipe(minifyCss())` it doesn't create a .min version of oneweb.css, it just creates compressed/minified css in that file. :("},"comment":{"url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/comments/202632758","html_url":"https://github.com/jakubpawlowicz/clean-css/issues/716#issuecomment-202632758","issue_url":"https://api.github.com/repos/jakubpawlowicz/clean-css/issues/716","id":202632758,"user":{"login":"anzorb","id":1194338,"avatar_url":"https://avatars.githubusercontent.com/u/1194338?v=3","gravatar_id":"","url":"https://api.github.com/users/anzorb","html_url":"https://github.com/anzorb","followers_url":"https://api.github.com/users/anzorb/followers","following_url":"https://api.github.com/users/anzorb/following{/other_user}","gists_url":"https://api.github.com/users/anzorb/gists{/gist_id}","starred_url":"https://api.github.com/users/anzorb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anzorb/subscriptions","organizations_url":"https://api.github.com/users/anzorb/orgs","repos_url":"https://api.github.com/users/anzorb/repos","events_url":"https://api.github.com/users/anzorb/events{/privacy}","received_events_url":"https://api.github.com/users/anzorb/received_events","type":"User","site_admin":false},"created_at":"2016-03-28T23:58:26Z","updated_at":"2016-03-28T23:58:26Z","body":"@jaminroe this should do it for you. This clones the source, allowing you to get to the source stream BEFORE it became the sourcemap.\r\n\r\n```\r\nvar $ = require('gulp-load-plugins')();\r\nvar gulp = require('gulp');\r\nvar merge = require('merge-stream');\r\n\r\ngulp.task('sass', function() {\r\n    var source = gulp.src('./src/scss/index.scss')\r\n        .pipe($.sourcemaps.init())\r\n        // compile sass into css\r\n        .pipe($.sass({ includePaths: './src' }).on('error', $.sass.logError))\r\n        // autoprefix css\r\n        .pipe($.autoprefixer(autoprefixerOptions));\r\n\r\n    var compile = source\r\n        .pipe($.clone())\r\n        .pipe($.rename(packageName + '.css'))\r\n        .pipe(gulp.dest(outputDir))\r\n        .pipe($.sourcemaps.write('.'))\r\n        .pipe(gulp.dest(outputDir));\r\n\r\n    var minify = source\r\n        .pipe($.clone())\r\n        .pipe($.rename(packageName + '.min.css'))\r\n        // minify\r\n        .pipe($.cssnano())\r\n        .pipe(gulp.dest(outputDir))\r\n\r\n    return merge(compile, minify);\r\n});\r\n```\r\n\r\nBTW, if you're deploying code to production, and want to log what kind of errors your customers/users are getting (with a tool like Sentry/Raven for examples), sourcemaps of minified code will show you the real error and not a cryptic minified file one. They're actually very useful.\r\n"}}