UNPKG

@serwist/webpack-plugin

Version:

A plugin for your webpack build process, helping you generate a manifest of local files that should be precached.

21 lines (18 loc) 713 B
import { p as performChildCompilation, r as relativeToOutputPath } from './chunks/perform-child-compilation.js'; import 'node:path'; class ChildCompilationPlugin { src; dest; plugins; constructor({ src, dest, plugins }){ this.src = src; this.dest = dest; this.plugins = plugins; } apply(compiler) { compiler.hooks.make.tapPromise(this.constructor.name, (compilation)=>performChildCompilation(compiler, compilation, this.constructor.name, this.src, relativeToOutputPath(compilation, this.dest), this.plugins).catch((error)=>{ compilation.errors.push(error); })); } } export { ChildCompilationPlugin, relativeToOutputPath };