Installer that adds Tailwind CSS dependencies and copies config files into a project.
// Source: https://github.com/t3-oss/create-t3-app | License: MIT | Copyright 2022 Shoubhit Dash
// Provided via justclaw.it.com; keep this notice with the code.
import path from "path";
import fs from "fs-extra";
import { PKG_ROOT } from "~/consts.js";
import { type Installer } from "~/installers/index.js";
import { addPackageDependency } from "~/utils/addPackageDependency.js";
export const tailwindInstaller: Installer = ({ projectDir }) => {
addPackageDependency({
projectDir,
dependencies: ["tailwindcss", "postcss", "@tailwindcss/postcss"],
devMode: true,
});
const extrasDir = path.join(PKG_ROOT, "template/extras");
const postcssCfgSrc = path.join(extrasDir, "config/postcss.config.js");
const postcssCfgDest = path.join(projectDir, "postcss.config.js");
const
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key