npm-publish-files
Copy special files `npm publish` always includes to a sub directory
Last updated 2 months ago by iiroj .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install npm-publish-files 
SYNC missed versions from official npm registry.

npm-publish-files

GitHub Actions version code size dependencies devDependencies

❯ npx npm-publish-files --help
Usage: npm-publish-files [options] <dir>

Copy special files `npm publish` always includes to a sub directory

Options:
  -V, --version         output the version number
  -f, --force           overwrite existing files (default: false)
  -c, --clean           remove files instead of copying (default: false)
  -i, --include <glob>  glob for additional files (default: [])
  -x, --exclude <glob>  glob to prevent copying files (default: [])
  -h, --help            display help for command

If you want to build a large npm project into a sub folder dist/, but then treat that as the root directory for the published package, you will need to copy all other special files npm includes in the publish. Let npm-publish-files do that for you!

Setup

This script will make sure all necessary files are copied to dist/ before running npm publish:

{
  "scripts": {
    "prepublishOnly": "npm-publish-files --force dist"
  }
}

Any additional files specified in the "file" property of package.json will also be copied.

After this your are free to run npm publish dist.

Files Copied

npm-publish-files uses the npm-packlist package under the hood to determine which files to copy. Please read its readme to better understand the algorhithm.

To copy additional files, supply one or more globs with the --include option. All matched files will be copied to <dir>.

To exclude files from being copied, supply one or more globs with the --exclude option. These will be applied last, so they filter both the default files, as well as those matched via the --include option.

Current Tags

  • 1.2.2                                ...           latest (2 months ago)

30 Versions

  • 1.2.2                                ...           2 months ago
  • 1.2.1                                ...           3 months ago
  • 1.2.0                                ...           3 months ago
  • 1.1.2                                ...           3 months ago
  • 1.1.1                                ...           3 months ago
  • 1.1.0                                ...           3 months ago
  • 1.0.21                                ...           5 months ago
  • 1.0.20                                ...           6 months ago
  • 1.0.19                                ...           8 months ago
  • 1.0.18                                ...           9 months ago
  • 1.0.17                                ...           9 months ago
  • 1.0.16                                ...           10 months ago
  • 1.0.15                                ...           a year ago
  • 1.0.14                                ...           a year ago
  • 1.0.13                                ...           a year ago
  • 1.0.12                                ...           a year ago
  • 1.0.11                                ...           a year ago
  • 1.0.9                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |