Skip to content

Commit

Permalink
Upgrade: Allow corePlugins in JS config files
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp-spiess committed Oct 21, 2024
1 parent 5ce37c4 commit 9ddbaf3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- _Upgrade (experimental)_: Migrate `plugins` with options to CSS ([#14700](https://github.com/tailwindlabs/tailwindcss/pull/14700))
- _Upgrade (experimental)_: Allow JS configuration files with `corePlugins` options to be migrated to CSS

### Fixed

Expand Down
7 changes: 7 additions & 0 deletions packages/@tailwindcss-upgrade/src/migrate-js-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ export async function migrateJsConfig(
if (themeConfig) cssConfigs.push(themeConfig)
}

if ('corePlugins' in unresolvedConfig) {
info(
`Your configuration file contains a \`corePlugins\` property, which is no longer available in Tailwind CSS v4. This option was not migrated to CSS.`,
)
}

let simplePlugins = findStaticPlugins(source)
if (simplePlugins !== null) {
for (let [path, options] of simplePlugins) {
Expand Down Expand Up @@ -214,6 +220,7 @@ function canMigrateConfig(unresolvedConfig: Config, source: string): boolean {
'plugins',
'presets',
'prefix', // Prefix is handled in the dedicated prefix migrator
'corePlugins',
]

if (Object.keys(unresolvedConfig).some((key) => !knownProperties.includes(key))) {
Expand Down

0 comments on commit 9ddbaf3

Please sign in to comment.