UNPKG

webpack-preprocessor-loader

Version:
24 lines (23 loc) 732 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.preprocessor = void 0; const global_1 = require("./global"); const printer_1 = require("./printer"); /** * The preprocessor * * @export * @param {IWebpackLoaderContext} this webpack loader context * @param {string} content raw text file * @returns {string} */ function preprocessor(content) { const { directives, params, verbose } = getOptions(this.query); return (0, printer_1.print)(content, directives, params, verbose); } exports.preprocessor = preprocessor; function getOptions(query) { const options = Object.assign({}, global_1.DEFAULT_OPTIONS, query); options.directives.debug = options.debug; return options; }