From b4642e7929867c5610806a37e59cce8ae5040ee2 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Fri, 26 Jan 2018 22:19:56 +0100 Subject: [PATCH] fix(index): source code indentation (#299) --- index.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index 631075e8..7474e59b 100644 --- a/index.js +++ b/index.js @@ -15,22 +15,22 @@ module.exports.pitch = function (request) { var options = loaderUtils.getOptions(this) || {}; validateOptions(require('./options.json'), options, 'Style Loader') - + options.hmr = typeof options.hmr === 'undefined' ? true : options.hmr; - // The variable is needed, because the function should be inlined. + // The variable is needed, because the function should be inlined. // If is just stored it in options, JSON.stringify will quote // the function and it would be just a string at runtime var insertInto; - - if (typeof options.insertInto === "function") { - insertInto = options.insertInto.toString(); + + if (typeof options.insertInto === "function") { + insertInto = options.insertInto.toString(); } - - // We need to check if it a string, or variable will be "undefined" + + // We need to check if it a string, or variable will be "undefined" // and the loader crashes - if (typeof options.insertInto === "string") { - insertInto = '"' + options.insertInto + '"'; + if (typeof options.insertInto === "string") { + insertInto = '"' + options.insertInto + '"'; } var hmr = [ @@ -79,11 +79,11 @@ module.exports.pitch = function (request) { "var transform;", "var insertInto;", "", - options.transform ? "transform = require(" + loaderUtils.stringifyRequest(this, "!" + path.resolve(options.transform)) + ");" : "", - "", + options.transform ? "transform = require(" + loaderUtils.stringifyRequest(this, "!" + path.resolve(options.transform)) + ");" : "", + "", "var options = " + JSON.stringify(options), "", - "options.transform = transform", + "options.transform = transform", "options.insertInto = " + insertInto + ";", "", // Add styles to the DOM