Copy Files
When working with monorepos, you may need to copy files from one package to another. This is useful when you want to use the same configuration files, scripts, or other assets across multiple packages. The monopkg copy
command allows you to copy files from one package to another within the monorepo.
Command
bash
monopkg copy [files...] [options]
bash
bun x monopkg copy [files...] [options]
bash
npx monopkg copy [files...] [options]
bash
yarn dlx monopkg copy [files...] [options]
Options
-s
,--source
<package>
- Source package to copy files from.-f
,--filter
<packages...>
- Include specific packages.-e
,--exclude
<packages...>
- Exclude specific packages.-w
,--workspace
<workspaces...>
- Root workspaces of the packages.
Examples
bash
monopkg copy eslint.config.js .prettierrc.js -s core -f apps/*
bash
bun x monopkg copy eslint.config.js .prettierrc.js -s core -f apps/*
bash
npx monopkg copy eslint.config.js .prettierrc.js -s core -f apps/*
bash
yarn dlx monopkg copy eslint.config.js .prettierrc.js -s core -f apps/*
The above command copies the eslint.config.js
and .prettierrc.js
files from the core
package to all packages in the apps
workspace.