From 39ad4f8a8d25f97ea7c83c91f301f7b7f3a23ab0 Mon Sep 17 00:00:00 2001 From: Johannes Ewald Date: Fri, 17 Mar 2017 01:14:34 +0100 Subject: [PATCH] feat: remove root option BREAKING CHANGE: The root option was never documented, so it's very unlikely that this is actually a breaking change. However, since the option was removed, we need to flag this as breaking. --- src/createWebpackLessPlugin.js | 4 ++-- src/getOptions.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/createWebpackLessPlugin.js b/src/createWebpackLessPlugin.js index e0d2fc40..380cf0f8 100644 --- a/src/createWebpackLessPlugin.js +++ b/src/createWebpackLessPlugin.js @@ -11,7 +11,7 @@ const trailingSlash = /[\\/]$/; * @param {string=} root * @returns {LessPlugin} */ -function createWebpackLessPlugin(loaderContext, root) { +function createWebpackLessPlugin(loaderContext) { const resolve = pify(loaderContext.resolve.bind(loaderContext)); const loadModule = pify(loaderContext.loadModule.bind(loaderContext)); @@ -22,7 +22,7 @@ function createWebpackLessPlugin(loaderContext, root) { } loadFile(filename, currentDirectory /* , options, environment */) { // eslint-disable-line class-methods-use-this - const moduleRequest = loaderUtils.urlToRequest(filename, root); + const moduleRequest = loaderUtils.urlToRequest(filename); // Less is giving us trailing slashes, but the context should have no trailing slash const context = currentDirectory.replace(trailingSlash, ''); let resolvedFilename; diff --git a/src/getOptions.js b/src/getOptions.js index f81a52d7..34fe8c2f 100644 --- a/src/getOptions.js +++ b/src/getOptions.js @@ -19,7 +19,7 @@ function getOptions(loaderContext) { options.filename = loaderContext.resource; // It's safe to mutate the array now because it has already been cloned - options.plugins.push(createWebpackLessPlugin(loaderContext, options.root)); + options.plugins.push(createWebpackLessPlugin(loaderContext)); return options; }