migrateJsConfig() — tailwindcss Function Reference
Architecture documentation for the migrateJsConfig() function in migrate-js-config.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 1ef01211_e07d_fbec_dcb1_d3c7a3bfe061["migrateJsConfig()"] b2ba3368_7330_fe20_4543_9cafa8cfedc0["migrate-js-config.ts"] 1ef01211_e07d_fbec_dcb1_d3c7a3bfe061 -->|defined in| b2ba3368_7330_fe20_4543_9cafa8cfedc0 6066f111_c660_b87d_6993_07d8cc779b5c["run()"] 6066f111_c660_b87d_6993_07d8cc779b5c -->|calls| 1ef01211_e07d_fbec_dcb1_d3c7a3bfe061 0dec976b_4cf5_63bb_0d29_f560fe197a3b["loadModule()"] 1ef01211_e07d_fbec_dcb1_d3c7a3bfe061 -->|calls| 0dec976b_4cf5_63bb_0d29_f560fe197a3b 7a3f2d88_6f0c_1a25_f3a3_982e5c35e67a["canMigrateConfig()"] 1ef01211_e07d_fbec_dcb1_d3c7a3bfe061 -->|calls| 7a3f2d88_6f0c_1a25_f3a3_982e5c35e67a f6cf39d1_9161_38f6_5e39_d0d0f34bb6a8["info()"] 1ef01211_e07d_fbec_dcb1_d3c7a3bfe061 -->|calls| f6cf39d1_9161_38f6_5e39_d0d0f34bb6a8 a81de696_6bb5_40db_26ca_1d707ccebed9["highlight()"] 1ef01211_e07d_fbec_dcb1_d3c7a3bfe061 -->|calls| a81de696_6bb5_40db_26ca_1d707ccebed9 efdaf4fe_1cde_66e0_60e0_5e155e297f6d["relative()"] 1ef01211_e07d_fbec_dcb1_d3c7a3bfe061 -->|calls| efdaf4fe_1cde_66e0_60e0_5e155e297f6d 450b80ee_7984_6c4f_fde3_a6c52f03baad["migrateDarkMode()"] 1ef01211_e07d_fbec_dcb1_d3c7a3bfe061 -->|calls| 450b80ee_7984_6c4f_fde3_a6c52f03baad 46b27b1d_7596_ed56_0fd7_dad5bfb7f12d["migrateContent()"] 1ef01211_e07d_fbec_dcb1_d3c7a3bfe061 -->|calls| 46b27b1d_7596_ed56_0fd7_dad5bfb7f12d e26bfad3_530e_6523_7463_161205321110["migrateTheme()"] 1ef01211_e07d_fbec_dcb1_d3c7a3bfe061 -->|calls| e26bfad3_530e_6523_7463_161205321110 7251786a_fd41_beea_80b3_e558e273b171["findStaticPlugins()"] 1ef01211_e07d_fbec_dcb1_d3c7a3bfe061 -->|calls| 7251786a_fd41_beea_80b3_e558e273b171 style 1ef01211_e07d_fbec_dcb1_d3c7a3bfe061 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/@tailwindcss-upgrade/src/codemods/config/migrate-js-config.ts lines 42–95
export async function migrateJsConfig(
designSystem: DesignSystem,
fullConfigPath: string,
base: string,
): Promise<JSConfigMigration> {
let [unresolvedConfig, source] = await Promise.all([
loadModule(fullConfigPath, __dirname, () => {}).then((result) => result.module) as Config,
fs.readFile(fullConfigPath, 'utf-8'),
])
if (!canMigrateConfig(unresolvedConfig, source)) {
info(
`The configuration file at ${highlight(relative(fullConfigPath, base))} could not be automatically migrated to the new CSS configuration format, so your CSS has been updated to load your existing configuration file.`,
{ prefix: '↳ ' },
)
return null
}
let sources: { base: string; pattern: string }[] = []
let plugins: { base: string; path: string; options: null | StaticPluginOptions }[] = []
let cssConfigs: string[] = []
if ('darkMode' in unresolvedConfig) {
cssConfigs.push(migrateDarkMode(unresolvedConfig as any))
}
if ('content' in unresolvedConfig) {
sources = await migrateContent(unresolvedConfig as any, fullConfigPath, base)
}
if ('theme' in unresolvedConfig) {
let themeConfig = await migrateTheme(designSystem, unresolvedConfig, base)
if (themeConfig) cssConfigs.push(themeConfig)
}
if ('corePlugins' in unresolvedConfig) {
info(
`The \`corePlugins\` option is no longer supported as of Tailwind CSS v4.0, so it's been removed from your configuration.`,
)
}
let simplePlugins = findStaticPlugins(source)
if (simplePlugins !== null) {
for (let [path, options] of simplePlugins) {
plugins.push({ base, path, options })
}
}
return {
sources,
plugins,
css: cssConfigs.join('\n'),
}
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does migrateJsConfig() do?
migrateJsConfig() is a function in the tailwindcss codebase, defined in packages/@tailwindcss-upgrade/src/codemods/config/migrate-js-config.ts.
Where is migrateJsConfig() defined?
migrateJsConfig() is defined in packages/@tailwindcss-upgrade/src/codemods/config/migrate-js-config.ts at line 42.
What does migrateJsConfig() call?
migrateJsConfig() calls 9 function(s): canMigrateConfig, findStaticPlugins, highlight, info, loadModule, migrateContent, migrateDarkMode, migrateTheme, and 1 more.
What calls migrateJsConfig()?
migrateJsConfig() is called by 1 function(s): run.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free