New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

makedeps

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

makedeps

Emits Make-compatible dependency files from browserify --list

  • 0.1.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

makedeps

JS script bundling/compiling tools have various ways to emit entry point dependencies. Browserify has a simple browserify --list option, which outputs a list of paths to files that the entry point depends on. Makedeps accepts that on stdin, and writes out a Make-compatible dependency file to stdout.

At some point this might end up supporting Webpack as well. (Which is why this exists to begin with, as the Browserify case could probably done using some sed magic)

Usage

makedeps <target-name>

Example

$ browserify foo.js -o foo-bundled.js --list
/path/to/bar.js
/path/to/baz.js

$ browserify foo.js -o foo-bundled.js --list | makedeps foo-bundles.js
foo-bundled.js: /path/to/bar.js \
    /path/to/baz.js

You'll probably want to send this output to a file, so that you can include it in your Makefile. An actual Makefile example is as follows:

ENTRIES = src/foo.js src/bar/baz.js

BROWSERIFY = node_modules/.bin/browserify
BFLAGS = -t [ babelify --presets [ es2015 react ] ]

all: $(addprefix build/dist/,$(ENTRIES))

# browserify can't generate deps and output files at the same time, so we have to
# do two separate bundles (one to actually bundle and one to get deps)
build/dist/%.js: src/%.js
    @echo "bundle " $<
    @mkdir -p $(dir $@) build/deps/$(dir $*)
    @$(BROWSERIFY) $< -o $@ $(BFLAGS)
    @$(BROWSERIFY) $< -o $@ $(BFLAGS) --list | node makedeps.js $@ > build/deps/$*.js.d

# include the generated deps so that changes to dependent files trigger rebuilds
-include $(addsuffix .d,$(addprefix build/deps/,$(ENTRIES)))

FAQs

Package last updated on 30 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc