P

dynamic-to-static-env-transformer

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

This codemod transforms import {$A} from '$env/dynamic/public'; and import {$A} from '$env/dynamic/private'; into their static counterparts, replacing them with import {$A} from '$env/static/public'; and import {$A} from '$env/static/private';, respectively. It ensures compatibility for prerendered pages and static deployments.

Note: This is a contrived example. Please modify it according to your use case.

Example

Before

ts

After

ts

Ready to contribute?

Build your own codemod and share it with the community.