0.2.2 • Published 4 months ago

copy-production-deps v0.2.2

Weekly downloads
4
License
MIT
Repository
github
Last release
4 months ago

Copy node production deps

npm Build status codecov

Find and copy production deps of package living in yarn workspace to dist folder.

NOTE: This is very experimental package., nevertheless it's used in one internal project to build minimal node_modules for services running in docker.

Usage

# copy deps of current folder to ./dist
$ npx copy-production-deps

# copy deps specific package to specific folder
$ npx copy-production-deps packages/foo-backend dist/foo-backend

# Only dist selected packages that are not bundled with esbuild
$ esbuild server.js --outfile dist/server.js --external:mongoose --external:hiredis
$ npx copy-production-deps . dist --only-packages mongoose,hiredis

Doc

Full synopsis:

copy-production-deps [packageDir] [distDir]

copy production deps from Npm/Yarn workspace to dist folder

Positionals:
  packageDir  source package folder (must contain package.json)   [default: "."]
  distDir     distribution directory (packages will be copied to
              ${distDir}/node_modules)                       [default: "./dist"]

Options:
  --version       Show version number                                  [boolean]
  --dryRun, -n    Dry run - only show what would be copied.
                                                      [boolean] [default: false]
  --verbose, -v   Run with verbose logging            [boolean] [default: false]
  --exclude-from  Read ecluded file patterns from file one pattern a line.
                                                           [array] [default: []]
  --exclude       Exclude file pattern (minimatch glob)    [array] [default: []]
  --only-packages Include only those packages         [array] [default: []
  --help          Show help                                            [boolean]

Why

Born from frustration that both yarn and npm have several bugs related to --production install and i almost wrote everywhere before i found copy-node-modules which apparently didn't support yarn workspaces.

Contribute

PRs accepted.

License

MIT © Zbigniew Zagórski

0.2.2

4 months ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago