publicBaseUrl: 'https://cdn.example.com/assets/'The storage prefix is assets; the URL includes it once. Production requires a deployment record verified against the current asset bytes. The CDN domain shown here is illustrative.
Make asset migration easier. Move your public/ assets to your desired storage provider, with supported asset references rewritten automatically during production builds—without manually updating your source code.
Next.js · Vite · React Native with Expo (experimental)
Before migrationYour assets are served from your application’s public/ directory.
<img src="/window.svg" alt="Window" />npx simpcn planLocal 1 added
Proposed transfer 385 B
upload window.svg
Remote unchecked · run simpcn plan --check-remote
Dry run · no changes made.
Add Simpcn as a dev dependency.
npm i -D simpcnMoving files is one task. Keeping every reference in sync is another.
<img src="/images/hero.webp" /><img src="/images/hero.webp" /><img src="/images/hero.webp" />Upload assets, then find and replace references across the source.
Migrate assets. The production build rewrites supported references.
Automatic rewriting has a defined scope. See which references are supported
One reference. Two environments.
Switch environments. The source stays the same.
<img src="/images/hero.webp" alt="Product preview" />https://cdn.example.com/assets/images/hero.webpDelivered from the configured CDN URL
publicBaseUrl: 'https://cdn.example.com/assets/'The storage prefix is assets; the URL includes it once. Production requires a deployment record verified against the current asset bytes. The CDN domain shown here is illustrative.
Preview first. Migrate next. Transform at build time.
Scan and fingerprint assets before uploading.
npx simpcn planUpload what’s needed and verify remote metadata.
npx simpcn migrateRewrite supported references using verified deployment records.
npm run buildReact Native with Expo, now in experimental support. Keep your image references while Simpcn prepares verified CDN sources for iOS, Android, and different screen densities.
.ios and .android files behind one image reference. Each platform gets its own family, with a generic fallback when needed.import { Image } from 'react-native';
import logo from './assets/cdn/logo.png';
<Image source={logo} />;logo.ios.png // 24 × 24 pixels
logo@2x.ios.png // 48 × 48 pixels
logo.android.png // 24 × 24 pixels
logo@3x.android.png // 72 × 72 pixelsThe Expo adapter is experimental. Android/iOS exports are tested; device, EAS, and OTA validation remain. Essential and excluded images stay local.
Explore React Native with ExpoKeep the framework. Add Simpcn to the configuration.
16.4 · webpack + Turbopack
Static media references and verified static next/image sources are supported. Next.js CSS references stay local.
Read the Next.js guideAlready installed? Initialize the project, then update the framework config.
npx simpcn init --framework nextimport { withSimpcn } from '@simpcn/next';
const nextConfig = {
// Keep existing Next.js settings here.
};
export default withSimpcn(nextConfig);Init creates the storage configuration and can install the adapter. Framework configuration stays explicit.
Connect an existing bucket and its public delivery URL. Credentials stay outside the client bundle.
Configure storageUpload and verify assets before the production build. Source files stay in place.
Scope, storage, and the details that matter.
The experimental Expo adapter handles static PNG/JPEG sources, iOS/Android variants, and @2x/@3x density files. Packed installation and platform exports are tested; device, EAS, and OTA validation remain. It does not cover Expo web or bare React Native. Explore the Expo integration.
The migration and supported reference transforms do not rewrite application source files. Original public/ files stay in place. The framework integration changes supported references in production build output. Check the reference support guide.
No. Static supported references can be transformed; arbitrary JavaScript strings, API responses, and dynamic paths are not automatically rewritten. Known dynamic asset paths can use the integration’s assetUrl() helper. Next.js CSS rewriting and Vue/Svelte template transforms are not implemented. Read the limitations.
The S3-compatible adapter has configuration for AWS S3, Cloudflare R2, and MinIO. Live integration tests currently cover local MinIO; AWS S3 and R2 have not been live-validated. The bucket, public access, and any CDN must already be configured. Simpcn does not provision them. See storage setup.
The next plan reports new, changed, unchanged, and locally removed assets. Migration verifies remote metadata and skips matching objects. Differing or unverified objects need --overwrite to replace them. Removed local files are reported; remote objects are kept. Review CDN caching after replacements. Explore the CLI.
No. Run migration before the application build. Builds read local deployment records and fail when a managed reference lacks matching verification. Those records describe a previous storage check, not a guarantee that a CDN URL is currently public or cached correctly. Read the setup guide.
Simpcn migrates assets and changes delivery URLs. It does not resize or optimize images. Supported static next/image references use direct CDN delivery with unoptimized; conflicting loader or optimization settings are left unchanged with a diagnostic. Review the integration limits.
Open source · v0.1
Try it. Share a rough edge. Contribute a fix.