From harness-claude
Guides use of static import declarations in JavaScript for tree-shaking unused exports, static analysis, IDE auto-imports, and bundler optimization with webpack, Vite, Rollup.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Use static import declarations to load ES modules at parse time for tree-shaking and static analysis
Guides static ES module imports in React for build-time bundling, tree-shaking unused code, and predictable loading performance. Use for immediate module needs, small utilities, types, or constants.
Guides Rollup bundler configuration for JavaScript libraries including plugins, tree shaking, code splitting, and multi-format ESM/CJS/UMD builds.
Guides es-toolkit installation, import patterns, setup, bundle size, and performance across Node.js, Bun, Deno, and browsers.
Share bugs, ideas, or general feedback.
Use static import declarations to load ES modules at parse time for tree-shaking and static analysis
import { name } from './module.js' at the top of the file for all compile-time dependencies.require() in ESM files — static import enables bundler dead-code elimination.// Named exports — tree-shakeable
import { useState, useEffect } from 'react';
import { formatDate, parseDate } from '../utils/date.js';
// Default export — avoid when possible
import MyComponent from './MyComponent.js';
import * as ns from './module.js' sparingly — it imports everything and can defeat tree-shaking.Static import declarations are resolved at parse time, before any code executes. This enables bundlers to analyze the dependency graph and eliminate unused exports (tree-shaking). Static imports are hoisted — they run before the module body regardless of where they appear in the file.
Trade-offs:
When NOT to use:
import() insteadhttps://patterns.dev/javascript/static-import