mix outerfaces.into_odd_cdn (Outerfaces Dependency Distribution (ODD) v0.2.5)
View SourceVendor a JS library into the app's outerfaces/projects/odd_cdn directory.
What gets copied
Task arguments —
include="lib,README.md",exclude="tests,tools".Application config —
config :outerfaces_odd, :odd_cdn, exclude: ["tests", "tools"]or per library:
config :outerfaces_odd, :odd_cdn, my_lib: [exclude: ["tests", "tools"]]The library's own
outerfaces.registry.json— the best place for it, since what a library publishes is the library's business and not every consumer's:{ "name": "my_lib", "version": "0.1.0", "odd_cdn": { "exclude": ["tests", "tools"] } }Defaults —
[".git", ".DS_Store", "node_modules", "_build", "deps", "cover", ".elixir_ls"], which are always excluded on top of whatever else is configured, because nothing wants them on a CDN.
include and exclude are lists of Path.wildcard/2 patterns relative to
the library root, so "tests" prunes a directory, "**/*.map" prunes by
extension anywhere, and "lib" (as an include) publishes that tree and
nothing else. An empty include means "everything not excluded", which is
the previous behaviour and stays the default.
Examples
mix outerfaces.into_odd_cdn
mix outerfaces.into_odd_cdn lib="my_lib" exclude="tests,tools"Currently depends on local source files.
TODO: Copy from a public git repo or tarball. TODO: Create a hash digest of the files copied and store it in a file in the target directory.
Summary
Functions
Callback implementation for Mix.Task.run/1.
Functions
Callback implementation for Mix.Task.run/1.