diff --git a/.changeset/olive-wolves-remember.md b/.changeset/olive-wolves-remember.md new file mode 100644 index 0000000..9cfe43f --- /dev/null +++ b/.changeset/olive-wolves-remember.md @@ -0,0 +1,5 @@ +--- +'@emigrate/cli': patch +--- + +Only load the JavaScript loader plugin if necessary diff --git a/packages/cli/src/commands/up.ts b/packages/cli/src/commands/up.ts index 4614f13..26ec568 100644 --- a/packages/cli/src/commands/up.ts +++ b/packages/cli/src/commands/up.ts @@ -16,7 +16,6 @@ import { } from '../errors.js'; import { type Config } from '../types.js'; import { withLeadingPeriod } from '../with-leading-period.js'; -import pluginLoaderJs from '../plugin-loader-js.js'; import { getMigrations } from '../get-migrations.js'; type ExtraFlags = { @@ -29,6 +28,7 @@ const getDuration = (start: [number, number]) => { }; const lazyDefaultReporter = async () => import('../reporters/default.js'); +const lazyPluginLoaderJs = async () => import('../plugin-loader-js.js'); export default async function upCommand({ storage: storageConfig, @@ -80,7 +80,7 @@ export default async function upCommand({ } const migrationFileExtensions = new Set(migrationFiles.map((migration) => migration.extension)); - const loaderPlugins = await getOrLoadPlugins('loader', [pluginLoaderJs, ...plugins]); + const loaderPlugins = await getOrLoadPlugins('loader', [lazyPluginLoaderJs, ...plugins]); const loaderByExtension = new Map( [...migrationFileExtensions].map(