CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-snowpack

A lightning-fast frontend build tool designed to leverage JavaScript's native ESM system for unbundled development with instant browser updates.

82

1.22x
Overview
Eval results
Files

task.mdevals/scenario-4/

Snowpack Project Inspector

A utility that inspects Snowpack projects to provide information about file URL mappings and installed dependencies.

Capabilities

File URL Resolution

Resolve local file paths to their corresponding web URLs based on Snowpack configuration.

  • Given file path /src/components/Button.tsx and a Snowpack config with mount { "src": "/dist" }, returns URL /dist/components/Button.tsx @test
  • Given file path /public/logo.png and a Snowpack config with mount { "public": "/" }, returns URL /logo.png @test

Dependency Inspection

Read the Snowpack lockfile to retrieve installed package information.

  • When a valid snowpack.deps.json exists in the current directory, returns the parsed lockfile data @test
  • When no lockfile exists in the specified directory, returns null @test

Implementation

@generates

API

/**
 * Resolves a file path to its URL based on Snowpack mount configuration.
 *
 * @param {string} filePath - Absolute file path to resolve
 * @param {object} snowpackConfig - Snowpack configuration object
 * @returns {string} The resolved URL
 */
function getFileUrl(filePath, snowpackConfig) {
  // Implementation here
}

/**
 * Reads the Snowpack lockfile from a directory.
 *
 * @param {string} directory - Directory path to search for lockfile
 * @returns {object|null} Lockfile contents or null if not found
 */
function getDependencies(directory) {
  // Implementation here
}

module.exports = {
  getFileUrl,
  getDependencies
};

Dependencies { .dependencies }

snowpack { .dependency }

Provides utility functions for file URL resolution and lockfile management.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-snowpack

tile.json