Skip to content

Commit

Permalink
refactor: load neo-async lazily (#1147)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jun 9, 2023
1 parent fb4217c commit 77e7a8b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import url from "url";
import path from "path";

import async from "neo-async";

function getDefaultSassImplementation() {
let sassImplPkg = "sass";

Expand Down Expand Up @@ -706,6 +704,9 @@ function getCompileFn(implementation, options) {
// We need to use a job queue to make sure that one thread is always available to the UV lib
if (nodeSassJobQueue === null) {
const threadPoolSize = Number(process.env.UV_THREADPOOL_SIZE || 4);
// Only used for `node-sass`, so let's load it lazily
// eslint-disable-next-line global-require
const async = require("neo-async");

nodeSassJobQueue = async.queue(
implementation.render.bind(implementation),
Expand Down

0 comments on commit 77e7a8b

Please sign in to comment.