Skip to content

11ty/eleventy-dependency-tree-esm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dependency-tree-esm

Returns an unordered array of local paths to dependencies of a Node ES module JavaScript file.

This is used by Eleventy to find dependencies of a JavaScript file to watch for changes to re-run Eleventy’s build.

Installation

npm install --save-dev @11ty/dependency-tree-esm

Features

  • Ignores bare specifiers (e.g. import "my-package")
  • Ignores Node’s built-ins (e.g. import "path")
  • Handles circular dependencies
  • Returns an empty set if the file does not exist.

Usage

// my-file.js

// if my-local-dependency.js has dependencies, it will include those too
import "./my-local-dependency.js";


// ignored, is a built-in
import path from "path";
const { find } = require("@11ty/dependency-tree-esm");

await find("./my-file.js");
// returns ["./my-local-dependency.js"]
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy