MCPcopy Create free account
hub / github.com/andywer/webpack-blocks / normalizeEntry

Function normalizeEntry

packages/webpack/index.js:84–103  ·  view source on GitHub ↗
(entry)

Source from the content-addressed store, hash-verified

82}
83
84function normalizeEntry(entry) {
85 if (Array.isArray(entry)) {
86 return {
87 main: entry
88 }
89 } else if (typeof entry === 'string') {
90 return {
91 main: [entry]
92 }
93 } else if (typeof entry === 'object') {
94 Object.keys(entry).forEach(entryName => {
95 if (!Array.isArray(entry[entryName])) {
96 entry[entryName] = [entry[entryName]]
97 }
98 })
99 return entry
100 } else {
101 throw new Error(`Expected entry point to be object, array or string. Instead got: ${entry}`)
102 }
103}
104
105/**
106 * @see https://webpack.github.io/docs/configuration.html#plugins

Callers 1

entryPointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…