| 732 | } |
| 733 | |
| 734 | function getModulesPlugins(options, loaderContext) { |
| 735 | const { |
| 736 | mode, |
| 737 | getLocalIdent, |
| 738 | localIdentName, |
| 739 | localIdentContext, |
| 740 | localIdentHashSalt, |
| 741 | localIdentHashFunction, |
| 742 | localIdentHashDigest, |
| 743 | localIdentHashDigestLength, |
| 744 | localIdentRegExp, |
| 745 | hashStrategy, |
| 746 | } = options.modules; |
| 747 | |
| 748 | let plugins = []; |
| 749 | |
| 750 | try { |
| 751 | plugins = [ |
| 752 | modulesValues, |
| 753 | localByDefault({ mode }), |
| 754 | extractImports(), |
| 755 | modulesScope({ |
| 756 | generateScopedName(exportName, resourceFile, rawCss, node) { |
| 757 | let localIdent; |
| 758 | |
| 759 | if (typeof getLocalIdent !== "undefined") { |
| 760 | localIdent = getLocalIdent( |
| 761 | loaderContext, |
| 762 | localIdentName, |
| 763 | unescape(exportName), |
| 764 | { |
| 765 | context: localIdentContext, |
| 766 | hashSalt: localIdentHashSalt, |
| 767 | hashFunction: localIdentHashFunction, |
| 768 | hashDigest: localIdentHashDigest, |
| 769 | hashDigestLength: localIdentHashDigestLength, |
| 770 | hashStrategy, |
| 771 | regExp: localIdentRegExp, |
| 772 | node, |
| 773 | }, |
| 774 | ); |
| 775 | } |
| 776 | |
| 777 | // A null/undefined value signals that we should invoke the default |
| 778 | // getLocalIdent method. |
| 779 | if (typeof localIdent === "undefined" || localIdent === null) { |
| 780 | localIdent = defaultGetLocalIdent( |
| 781 | loaderContext, |
| 782 | localIdentName, |
| 783 | unescape(exportName), |
| 784 | { |
| 785 | context: localIdentContext, |
| 786 | hashSalt: localIdentHashSalt, |
| 787 | hashFunction: localIdentHashFunction, |
| 788 | hashDigest: localIdentHashDigest, |
| 789 | hashDigestLength: localIdentHashDigestLength, |
| 790 | hashStrategy, |
| 791 | regExp: localIdentRegExp, |