UNPKG

@nx/remix

Version:

The Remix plugin for Nx contains executors and generators for managing Remix applications and libraries within an Nx workspace. It provides: - Integration with libraries such as Vitest, Jest, Playwright, Cypress, and Storybook. - Generators for applica

27 lines (26 loc) 1.34 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = setupTailwind; const devkit_1 = require("@nx/devkit"); const versions_1 = require("../../utils/versions"); const insert_statement_after_imports_1 = require("../../utils/insert-statement-after-imports"); async function setupTailwind(tree, options) { devkit_1.logger.warn(`The 'setup-tailwind' generator is deprecated. Generating Tailwind configuration is no longer maintained. This generator will be removed in Nx 23.`); const project = (0, devkit_1.readProjectConfiguration)(tree, options.project); (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), project.root, { tpl: '', }); const pathToRoot = (0, devkit_1.joinPathFragments)(project.root, 'app/root.tsx'); (0, insert_statement_after_imports_1.insertStatementAfterImports)(tree, pathToRoot, (0, devkit_1.stripIndents) `import './tailwind.css';`); (0, devkit_1.addDependenciesToPackageJson)(tree, { tailwindcss: versions_1.tailwindVersion, postcss: versions_1.postcssVersion, autoprefixer: versions_1.autoprefixerVersion, }, {}); if (!options.skipFormat) { await (0, devkit_1.formatFiles)(tree); } return () => { (0, devkit_1.installPackagesTask)(tree); }; }