MCPcopy Index your code
hub / github.com/webpack/css-loader / normalizeOptions

Function normalizeOptions

src/utils.js:667–696  ·  view source on GitHub ↗
(rawOptions, loaderContext)

Source from the content-addressed store, hash-verified

665}
666
667function normalizeOptions(rawOptions, loaderContext) {
668 const exportType =
669 typeof rawOptions.exportType === "undefined"
670 ? "array"
671 : rawOptions.exportType;
672 const esModule =
673 typeof rawOptions.esModule === "undefined" ? true : rawOptions.esModule;
674 const modulesOptions = getModulesOptions(
675 rawOptions,
676 esModule,
677 exportType,
678 loaderContext,
679 );
680
681 return {
682 url: typeof rawOptions.url === "undefined" ? true : rawOptions.url,
683 import: typeof rawOptions.import === "undefined" ? true : rawOptions.import,
684 modules: modulesOptions,
685 sourceMap:
686 typeof rawOptions.sourceMap === "boolean"
687 ? rawOptions.sourceMap
688 : loaderContext.sourceMap,
689 importLoaders:
690 typeof rawOptions.importLoaders === "string"
691 ? parseInt(rawOptions.importLoaders, 10)
692 : rawOptions.importLoaders,
693 esModule,
694 exportType,
695 };
696}
697
698function shouldUseImportPlugin(options) {
699 if (options.modules.exportOnlyLocals) {

Callers 1

loaderFunction · 0.90

Calls 1

getModulesOptionsFunction · 0.85

Tested by

no test coverage detected