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-3/

Static Asset Server

A lightweight HTTP server for serving static assets during frontend development with automatic rebuilds on file changes.

Capabilities

Server Initialization

Starts a development server that serves static files from specified directories.

  • The server starts successfully and listens on a configurable port @test
  • The server provides methods to handle HTTP requests for files @test

File Serving

Serves files from mounted directories with proper content types.

  • Static HTML files are served correctly with text/html content type @test
  • JavaScript modules are served correctly with proper ESM content type @test

File Watching

Automatically detects file changes and triggers rebuilds.

  • File changes in mounted directories are detected @test
  • Server provides file loading capabilities for changed files @test

Server Shutdown

Gracefully stops the server and cleans up resources.

  • The server stops cleanly when requested @test

Implementation

@generates

API

/**
 * Starts a development server for serving static assets.
 *
 * @param {Object} commandOptions - Configuration options for the server
 * @param {number} commandOptions.port - Port number to listen on (default: 8080)
 * @param {string} commandOptions.hostname - Hostname to bind to (default: 'localhost')
 * @param {Object} commandOptions.config - Server configuration including mount points
 * @param {Object} options - Additional server options
 * @returns {Promise<Object>} Server instance with methods for handling requests
 */
async function startServer(commandOptions, options) {
  // Implementation here
}

/**
 * Shuts down the server gracefully.
 *
 * @param {Object} serverInstance - The server instance to shut down
 * @returns {Promise<void>}
 */
async function shutdownServer(serverInstance) {
  // Implementation here
}

module.exports = {
  startServer,
  shutdownServer
};

Dependencies { .dependencies }

snowpack { .dependency }

Provides development server functionality with unbundled file serving, file watching, and on-the-fly transpilation.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-snowpack

tile.json