Skip to content

Commit

Permalink
fix: Update npm + Tailwind CSS initialization for TailwindCSS 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wimdeblauwe committed Jan 28, 2025
1 parent bd56e5e commit b630e54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
import io.github.wimdeblauwe.ttcli.livereload.TailwindCssSpecializedLiveReloadInitService;
import io.github.wimdeblauwe.ttcli.livereload.helper.TailwindCssHelper;
import io.github.wimdeblauwe.ttcli.npm.NodeService;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Order(2)
Expand All @@ -39,12 +38,8 @@ public void generate(ProjectInitializationParameters projectInitializationParame

TailwindCssHelper.createApplicationCss(projectInitializationParameters.basePath(),
"src/main/resources/static/css/application.css");
TailwindCssHelper.setupTailwindConfig(projectInitializationParameters.basePath(), "./src/main/resources/templates/**/*.html");
} catch (IOException e) {
throw new LiveReloadInitServiceException(e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new LiveReloadInitServiceException(e);
}
}

Expand All @@ -61,6 +56,7 @@ protected String postcssConfigFilePath() {
protected List<String> npmDevDependencies() {
List<String> dependencies = new ArrayList<>(super.npmDevDependencies());
dependencies.add("tailwindcss");
dependencies.add("@tailwindcss/postcss");
return dependencies;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const postcssConfig = {
plugins: [require('autoprefixer'),
require('tailwindcss')],
plugins: [
require('@tailwindcss/postcss')],
};

// If we are in production mode, then add cssnano
Expand Down

0 comments on commit b630e54

Please sign in to comment.