How to use less-loader - 2 common examples

To help you get started, we’ve selected a few less-loader examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gadyonysh / semantic-ui-less-module-loader / index.js View on Github external
config
  );

  var originalResolve = this.resolve;

  this.resolve = function(context, moduleRequest, callback)
  {
    moduleRequest = moduleRequest
      .replace(themeConfigPattern, function() { return config.themeConfigPath; })
      .replace(themePattern, function() { return config.themePath; })
      .replace(folderPattern, function($0, dir) { return config[dir + 'Folder']; });

    return originalResolve.call(this, context, moduleRequest, callback);
  };

  return lessLoader.call(this, source);
};
github intoli / antd-scss-theme-plugin / src / antdLessLoader.js View on Github external
export default function antdLessLoader(...args) {
  const loaderContext = this;
  const options = getOptions(loaderContext);

  const newLoaderContext = { ...loaderContext };
  const newOptions = overloadLessLoaderOptions(options);
  delete newOptions.scssThemePath;
  newLoaderContext.query = newOptions;

  const scssThemePath = getScssThemePath(options);
  newLoaderContext.addDependency(scssThemePath);

  return lessLoader.call(newLoaderContext, ...args);
}

less-loader

A Less loader for webpack. Compiles Less to CSS.

MIT
Latest version published 9 months ago

Package Health Score

88 / 100
Full package analysis

Popular less-loader functions