Skip to content

Commit

Permalink
chore: remove sync check (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Clark authored Mar 16, 2020
1 parent ebdc1e8 commit fed50ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
12 changes: 2 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,10 @@ function lessLoader(source) {
baseDataPath: 'options',
});

const done = this.async();
const isSync = typeof done !== 'function';

if (isSync) {
throw new Error(
'Synchronous compilation is not supported anymore. See https:/webpack-contrib/less-loader/issues/84'
);
}

const callback = this.async();
const lessOptions = getLessOptions(this, options);

processResult(this, render(source, lessOptions));
processResult(this, render(source, lessOptions), callback);
}

export default lessLoader;
5 changes: 2 additions & 3 deletions src/processResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ const formatLessError = require('./formatLessError');
*
* @param {loaderContext} loaderContext
* @param {Promise<LessResult>} resultPromise
* @param {Function} callback
*/
function processResult(loaderContext, resultPromise) {
const { callback } = loaderContext;

function processResult(loaderContext, resultPromise, callback) {
resultPromise
.then(
({ css, map, imports }) => {
Expand Down

0 comments on commit fed50ba

Please sign in to comment.