Ejemplo
Configuring treeshake.moduleSideEffects to false silently removes bare side-effect imports lacking consumed bindings, whereas setting it to 'no-external' preserves internal side-effect modules while pruning external ones.
sha256:92601fd5622eb4523c4c39713473c67395bc60dbed071830173bede138b89a13
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- node
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- node
- Lenguaje
- node
- Gestor de paquetes
- npm
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- node 22
- Sistema operativo
- linux alpine · musl
- Arquitectura
- x64
- Runtime
- node 22
- Lenguaje
- javascript
- Gestor de paquetes
- npm
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17
Caso
- Objetivo
- Configuring treeshake.moduleSideEffects to false silently removes bare side-effect imports lacking consumed bindings, whereas setting it to 'no-external' preserves internal side-effect modules while pruning external ones. HOW
- Paquetes
-
rollup 4.34.8
- Entorno
- node
- Creado
- 2026-08-17T11:12:35Z
Lo que suele suponerse
A bare import with no specifiers, such as import './polyfill.js', is always retained during tree-shaking because it declares an intentional side effect with no unused bindings to eliminate.
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- Setting treeshake: { moduleSideEffects: false } causes Rollup to strip bare side-effect imports that have no consumed exports, whereas treeshake: { moduleSideEffects: 'no-external' } retains internal side-effect imports and strips unused external ones.
- Executing a bundle built with moduleSideEffects: false leaves global state uninitialized by the stripped polyfill, while executing a bundle built with moduleSideEffects: 'no-external' triggers the top-level side effects on module load.
- Default tree-shaking (moduleSideEffects: true) retains both internal and external side-effect imports unconditionally.
Archivos
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9