CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-filemanager-webpack-plugin

Webpack plugin to copy, archive (.zip), move, delete files and directories before and after builds

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

move.mddocs/

Move Operations

Move individual files or entire directories from source to destination locations with automatic path resolution and cross-platform compatibility.

Capabilities

Move Action Function

Main move action function that processes move tasks.

/**
 * Execute move tasks with the provided options
 * @param tasks Array of move tasks to execute
 * @param taskOptions Task execution options including logger and error handling
 */
function moveAction(tasks: MoveTask[], taskOptions: TaskOptions): Promise<void>;

export default moveAction;

Move Action Configuration

Configuration interface for move operations with source and destination paths.

/**
 * Configuration for move operations
 */
interface MoveAction {
  /** Source file or directory path */
  source: string;
  /** Destination file or directory path */
  destination: string;
}

Internal Task Structure

Internal task structure used by the plugin during move execution.

/**
 * Internal task structure for move operations
 */
interface MoveTask {
  source: string;
  absoluteSource: string;
  destination: string;
  absoluteDestination: string;
}

Usage Examples:

// Basic file move
{
  move: [
    { source: './temp/config.json', destination: './dist/config.json' }
  ]
}

// Directory move
{
  move: [
    { source: './build/assets', destination: './dist/assets' }
  ]
}

// Multiple move operations
{
  move: [
    { source: './temp/bundle.js', destination: './dist/app.js' },
    { source: './temp/styles.css', destination: './dist/styles.css' },
    { source: './temp/images', destination: './dist/assets/images' }
  ]
}

// Move with rename
{
  move: [
    { source: './src/main.js', destination: './dist/bundle.js' },
    { source: './docs', destination: './dist/documentation' }
  ]
}

Move Behavior

File and Directory Handling

  • File to File: Move and optionally rename file
  • File to Directory: Move file into destination directory
  • Directory to Directory: Move entire directory and contents
  • Cross-device: Handles moves across different file systems

Path Resolution

  • Relative paths resolved against plugin context or Webpack context
  • Absolute paths used as-is
  • Destination directories created automatically if they don't exist

Move vs Copy+Delete

Move operations are atomic where possible:

  • On same file system: True move operation
  • Cross file system: Copy then delete (handled internally by fs-extra)

Error Handling

Move operations handle various error conditions:

  • Source not found: Error logged and handled based on throwOnError setting
  • Destination exists: Existing files/directories are overwritten
  • Permission errors: Logged and handled based on error configuration
  • Cross-device moves: Automatically handled by fs-extra library

Limitations

  • Glob patterns: Not supported for move operations (use copy + delete instead)
  • Options: No additional options supported (unlike copy operations)
  • Atomic operations: Limited to same file system moves

docs

archive.md

configuration.md

copy.md

delete.md

index.md

mkdir.md

move.md

tile.json