MCPcopy Create free account
hub / github.com/webpack/webpack-cli / #loadPackage

Method #loadPackage

packages/webpack-cli/src/webpack-cli.ts:1907–1912  ·  view source on GitHub ↗
(pkg: string, isCustom: boolean)

Source from the content-addressed store, hash-verified

1905 }
1906
1907 async #loadPackage<T>(pkg: string, isCustom: boolean): Promise<T> {
1908 const importTarget =
1909 isCustom && /^(?:[A-Za-z]:(\\|\/)|\\\\|\/)/.test(pkg) ? pathToFileURL(pkg).toString() : pkg;
1910
1911 return (await import(importTarget)).default;
1912 }
1913
1914 async loadWebpack(): Promise<typeof webpack> {
1915 return this.#loadPackage(WEBPACK_PACKAGE, WEBPACK_PACKAGE_IS_CUSTOM);

Callers 2

loadWebpackMethod · 0.95
loadWebpackDevServerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected