sass-all-variable-loader
Version:
Loads sass files and extracts all variable declarations including from the imported sass files.
14 lines (13 loc) • 702 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var loaderUtils = require("loader-utils");
var extractVariables_1 = require("./extractVariables");
var loader = function loader() {
this.cacheable();
var _a = loaderUtils.getOptions(this), _b = _a.includePaths, includePaths = _b === void 0 ? [] : _b, _c = _a.camelCase, camelCase = _c === void 0 ? false : _c;
var filePath = this.context;
includePaths.unshift(filePath);
var variables = extractVariables_1.extractVariables(this.resourcePath, { includePaths: includePaths, camelCase: camelCase });
return 'module.exports = ' + JSON.stringify(variables) + ';';
};
exports.default = loader;