Skip to content

Commit

Permalink
chore: change globToRegex to RegExp
Browse files Browse the repository at this point in the history
  • Loading branch information
tthijm committed Feb 27, 2024
1 parent 704f0f4 commit 927734f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/DefinePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

"use strict";

const globToRegex = require("glob-to-regexp");
const {
JAVASCRIPT_MODULE_TYPE_AUTO,
JAVASCRIPT_MODULE_TYPE_ESM,
Expand Down Expand Up @@ -309,10 +308,10 @@ const PLUGIN_NAME = "DefinePlugin";
const VALUE_DEP_PREFIX = `webpack/${PLUGIN_NAME} `;
const VALUE_DEP_MAIN = `webpack/${PLUGIN_NAME}_hash`;
const TYPEOF_OPERATOR_REGEXP = /^typeof\s+/;
const WEBPACK_REQUIRE_FUNCTION_REGEXP = globToRegex(
RuntimeGlobals.requireScope
const WEBPACK_REQUIRE_FUNCTION_REGEXP = new RegExp(
`${RuntimeGlobals.require}\\..*`
);
const WEBPACK_REQUIRE_IDENTIFIER_REGEXP = globToRegex(RuntimeGlobals.require);
const WEBPACK_REQUIRE_IDENTIFIER_REGEXP = new RegExp(RuntimeGlobals.require);

class DefinePlugin {
/**
Expand Down

0 comments on commit 927734f

Please sign in to comment.