diff options
author | 2020-11-18 23:26:45 +0100 | |
---|---|---|
committer | 2020-11-18 23:26:45 +0100 | |
commit | 81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch) | |
tree | 8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/node-sass/lib/render.js | |
parent | 1870f3fdf43707a15fda0f609a021f516f45eb63 (diff) | |
download | website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2 website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip |
rm node_modules
Diffstat (limited to 'node_modules/node-sass/lib/render.js')
-rw-r--r-- | node_modules/node-sass/lib/render.js | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/node_modules/node-sass/lib/render.js b/node_modules/node-sass/lib/render.js deleted file mode 100644 index 858e02e..0000000 --- a/node_modules/node-sass/lib/render.js +++ /dev/null @@ -1,121 +0,0 @@ -/*! - * node-sass: lib/render.js - */ - -var chalk = require('chalk'), - fs = require('fs'), - mkdirp = require('mkdirp'), - path = require('path'), - sass = require('./'); - -/** - * Render - * - * @param {Object} options - * @param {Object} emitter - * @api public - */ - -module.exports = function(options, emitter) { - var renderOptions = { - includePaths: options.includePath, - omitSourceMapUrl: options.omitSourceMapUrl, - indentedSyntax: options.indentedSyntax, - outFile: options.dest, - outputStyle: options.outputStyle, - precision: options.precision, - sourceComments: options.sourceComments, - sourceMapEmbed: options.sourceMapEmbed, - sourceMapContents: options.sourceMapContents, - sourceMap: options.sourceMap, - sourceMapRoot: options.sourceMapRoot, - importer: options.importer, - functions: options.functions, - indentWidth: options.indentWidth, - indentType: options.indentType, - linefeed: options.linefeed - }; - - if (options.data) { - renderOptions.data = options.data; - } else if (options.src) { - renderOptions.file = options.src; - } - - var sourceMap = options.sourceMap; - var destination = options.dest; - var stdin = options.stdin; - - var success = function(result) { - var todo = 1; - var done = function() { - if (--todo <= 0) { - emitter.emit('done'); - } - }; - - if (!destination || stdin) { - emitter.emit('log', result.css.toString()); - - if (sourceMap && !options.sourceMapEmbed) { - emitter.emit('log', result.map.toString()); - } - - return done(); - } - - emitter.emit('info', chalk.green('Rendering Complete, saving .css file...')); - - mkdirp(path.dirname(destination), function(err) { - if (err) { - return emitter.emit('error', chalk.red(err)); - } - - fs.writeFile(destination, result.css.toString(), function(err) { - if (err) { - return emitter.emit('error', chalk.red(err)); - } - - emitter.emit('info', chalk.green('Wrote CSS to ' + destination)); - emitter.emit('write', err, destination, result.css.toString()); - done(); - }); - }); - - if (sourceMap) { - todo++; - - mkdirp(path.dirname(sourceMap), function(err) { - if (err) { - return emitter.emit('error', chalk.red(err)); - } - fs.writeFile(sourceMap, result.map, function(err) { - if (err) { - return emitter.emit('error', chalk.red('Error' + err)); - } - - emitter.emit('info', chalk.green('Wrote Source Map to ' + sourceMap)); - emitter.emit('write-source-map', err, sourceMap, result.map); - done(); - }); - }); - } - - emitter.emit('render', result.css.toString()); - }; - - var error = function(error) { - emitter.emit('error', chalk.red(JSON.stringify(error, null, 2))); - }; - - var renderCallback = function(err, result) { - if (err) { - error(err); - } - else { - success(result); - } - }; - - sass.render(renderOptions, renderCallback); -}; |