MCPcopy
hub / github.com/webpack/webpack / getReplacements

Function getReplacements

lib/APIPlugin.js:41–139  ·  view source on GitHub ↗

* Returns the replacement definitions used for webpack API identifiers. * @returns {Record<string, { expr: string, req: string[] | null, type?: string, assign: boolean }>} replacements

()

Source from the content-addressed store, hash-verified

39 * @returns {Record<string, { expr: string, req: string[] | null, type?: string, assign: boolean }>} replacements
40 */
41function getReplacements() {
42 return {
43 __webpack_require__: {
44 expr: RuntimeGlobals.require,
45 req: [RuntimeGlobals.require],
46 type: "function",
47 assign: false
48 },
49 __webpack_global__: {
50 expr: RuntimeGlobals.require,
51 req: [RuntimeGlobals.require],
52 type: "function",
53 assign: false
54 },
55 __webpack_public_path__: {
56 expr: RuntimeGlobals.publicPath,
57 req: [RuntimeGlobals.publicPath],
58 type: "string",
59 assign: true
60 },
61 __webpack_base_uri__: {
62 expr: RuntimeGlobals.baseURI,
63 req: [RuntimeGlobals.baseURI],
64 type: "string",
65 assign: true
66 },
67 __webpack_modules__: {
68 expr: RuntimeGlobals.moduleFactories,
69 req: [RuntimeGlobals.moduleFactories],
70 type: "object",
71 assign: false
72 },
73 __webpack_chunk_load__: {
74 expr: RuntimeGlobals.ensureChunk,
75 req: [RuntimeGlobals.ensureChunk],
76 type: "function",
77 assign: true
78 },
79 __non_webpack_require__: {
80 expr: "require",
81 req: null,
82 type: undefined, // type is not known, depends on environment
83 assign: true
84 },
85 __webpack_nonce__: {
86 expr: RuntimeGlobals.scriptNonce,
87 req: [RuntimeGlobals.scriptNonce],
88 type: "string",
89 assign: true
90 },
91 __webpack_hash__: {
92 expr: `${RuntimeGlobals.getFullHash}()`,
93 req: [RuntimeGlobals.getFullHash],
94 type: "string",
95 assign: false
96 },
97 __webpack_chunkname__: {
98 expr: RuntimeGlobals.chunkName,

Callers 1

applyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected