Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
style.on('end', function(err, css) {
var sourceMap = sourceMapResolve.resolveSourceMapSync(css, null, fs.readFile);
var mangled = mangle(css, sourceMap.map, {
camelCase: pluginOptions.camelCase,
projection: pluginOptions.projection
});
if (typeof pluginOptions.target === 'function') {
pluginOptions.target(style.options.filename, mangled.map);
} else {
for (var i in mangled.map) {
var relativePath = path.relative(srcDir, path.resolve(destDir, i));
if (~relativePath.indexOf('..')) {
console.log(color.yellow('Traversal path "' + relativePath + '" is not output.'));
continue;
}
var styl = path.parse(relativePath);
var variableName = camelCase(styl.name);
var outputPath = path.resolve(scriptDir, relativePath.replace(new RegExp(styl.ext + '$'), '.' + target));