});
}
+if (cleanOptions.sourceMap && !cleanOptions.target) {
+ outputFeedback(['Source maps will not be built because you have not specified an output file.'], true);
+ cleanOptions.sourceMap = false;
+}
+
// ... and do the magic!
if (options.sources) {
var data = options.sources
if (this.errors.length > 0)
process.exit(1);
- if (minified.sourceMap && options.target) {
+ if (minified.sourceMap) {
var mapFilename = path.basename(options.target) + '.map';
output(minified.styles + '/*# sourceMappingURL=' + mapFilename + ' */');
outputMap(minified.sourceMap, mapFilename);
})
},
'source maps': {
+ 'no target file': binaryContext('--source-map ./test/data/reset.css', {
+ 'warns about source map not being build': function (error, stdout, stderr) {
+ assert.include(stderr, 'Source maps will not be built because you have not specified an output file.');
+ },
+ 'does not include map in stdout': function (error, stdout) {
+ assert.notInclude(stdout, '/*# sourceMappingURL');
+ }
+ }),
'output file': binaryContext('--source-map -o ./reset.min.css ./test/data/reset.css', {
'includes map in minified file': function() {
assert.include(readFile('./reset.min.css'), '/*# sourceMappingURL=reset.min.css.map */');