Skip to content

Generates bundledDependencies package.json value using values of the dependencies property. Updates package.json definition using the generated bundledDependencies value.

License

Notifications You must be signed in to change notification settings

gajus/bundle-dependencies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bundle-dependencies

NPM version Travis build status js-canonical-style

Generates bundledDependencies package.json value using values of the dependencies property. Updates package.json definition using the generated bundledDependencies value.

Install

npm install bundle-dependencies

Add to package.json:

{
    "scripts": {
        "bundle-dependencies": "bundle-dependencies"
    }
}

Options

bundle-dependencies --help
Commands:
  list-bundled-dependencies  Lists names of bundled dependencies.
  update                     Updates package.json bundledDependencies
                             definition.

Options:
  --help  Show help                                                    [boolean]
bundle-dependencies update --help
Options:
  --help     Show help                                                 [boolean]
  --exclude  A space-separated list of dependencies not to include in the
             bundledDependencies definition.               [array] [default: []]

Usage

To simply update bundledDependencies of the package.json in the current working directory, execute the script:

npm run bundle-dependencies update

Publishing

When publishing a package using bundledDependencies property, make sure that your node_modules/ directory includes only bundled dependencies, i.e. the module must be installed using npm install --production [list of bundled dependencies]. Use this script to do it:

{
    "bundle-publish": "npm run bundle-dependencies update; git commit -m 'Bundled dependencies.' ./package.json; git push; rm -fr ./node_modules; npm install --production $(bundle-dependencies list-bundled-dependencies); npm dedupe; npm prune; npm publish; npm install;"
}

About

Generates bundledDependencies package.json value using values of the dependencies property. Updates package.json definition using the generated bundledDependencies value.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published