Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vue): tailwind generator ignoring styleSheet option #21840

Merged
merged 1 commit into from Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -24,6 +24,10 @@ export function addTailwindStyleImports(
project: ProjectConfiguration,
_options: SetupTailwindOptions
) {
if (_options.stylesheet) {
knownStylesheetLocations.push(_options.stylesheet);
}

const stylesPath = knownStylesheetLocations
.map((file) => joinPathFragments(project.root, file))
.find((file) => tree.exists(file));
Expand Down
Expand Up @@ -42,6 +42,30 @@ describe('vue setup-tailwind generator', () => {
);
});

it('should update existing stylesheet passed with option', async () => {
const tree = createTreeWithEmptyWorkspace();
addProjectConfiguration(tree, 'example', {
root: 'example',
sourceRoot: 'example/src',
targets: {},
});
tree.write(`example/src/style.css`, `/* existing content */`);

await update(tree, {
project: 'example',
stylesheet: 'src/style.css',
});

expect(tree.read(`example/src/style.css`).toString()).toContain(
stripIndents`
@tailwind base;
@tailwind components;
@tailwind utilities;
/* existing content */
`
);
});

it('should install packages', async () => {
const tree = createTreeWithEmptyWorkspace();
addProjectConfiguration(tree, 'example', {
Expand Down