MCPcopy
hub / github.com/prisma/prisma / fillPlugin

Function fillPlugin

helpers/compile/plugins/fill-plugin/fillPlugin.ts:219–244  ·  view source on GitHub ↗
({ fillerOverrides, defaultFillers = true }: FillPluginOptions)

Source from the content-addressed store, hash-verified

217 * @returns
218 */
219const fillPlugin = ({ fillerOverrides, defaultFillers = true }: FillPluginOptions): esbuild.Plugin => ({
220 name: 'fillPlugin',
221 setup(build) {
222 const uid = Math.random().toString(36).substring(7) + ''
223 const namespace = `fill-plugin-${uid}`
224
225 // overrides
226 const fillers = {
227 ...(defaultFillers ? defaultFillersConfig : {}),
228 ...fillerOverrides,
229 }
230
231 // our first step is to update options with basic injections
232 setInjectionsAndDefinitions(fillers, build.initialOptions)
233
234 // allows us to change the path of a filtered import by another
235 build.onResolve({ filter: createImportFilter(fillers) }, (args) => {
236 return onResolve(fillers, args, namespace)
237 })
238
239 // if no path was provided it defers to virtual nsp `fill-plugin`
240 build.onLoad({ filter: /.*/, namespace }, (args) => {
241 return onLoad(fillers, args)
242 })
243 },
244})
245
246export { fillPlugin }

Callers 2

wasmBindgenRuntimeConfigFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected