Reset the output directory
Use emptyDir() to keep the root directory in place while removing old output before each build.
@carry0987/plugin-manager
Organize front-end packages and static assets with declarative rules.
1PluginManager.emptyDir('public/vendor');23PluginManager.copyPackages('node_modules', 'public/vendor', [4 {5 name: 'bootstrap',6 from: 'dist',7 include: ['**/bootstrap.bundle.min.js', '**/bootstrap.min.css'],8 },9]);1011PluginManager.copyFiles('src/assets', 'public/vendor', {12 exclude: ['**/*.map'],13});
Output is always constrained to targetDir/<package-name>/...
Core Capabilities
Rule Driven
Define package names, source folders, included files, and excluded files directly in code so the asset pipeline stays readable and maintainable.
Safe Output
Package output is always confined to targetDir/<package-name>/..., and conflicting rules fail fast instead of silently replacing files.
Mixed Sources
Copy third-party assets from node_modules, merge in local templates or overrides, and finish with cleanup steps in one workflow.
Workflow
Use emptyDir() to keep the root directory in place while removing old output before each build.
Run copyPackages() first, then use copyFiles() for local templates, overrides, and extra assets.
Finish with clearUnnecessaryFiles() and clearEmptyDirs() to remove unwanted files and empty folders.