# Tailwind external build and exporting files to a theme

**URL:** <https://forum.pinegrow.com/t/tailwind-external-build-and-exporting-files-to-a-theme/8766>\
**Category:** Pinegrow WP\
**Tags:** wordpress, tailwind, theme\
**Created:** [March 11, 2024, 8:14pm UTC](https://forum.pinegrow.com/t/tailwind-external-build-and-exporting-files-to-a-theme/8766 "2024-03-11T20:14:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![piootr](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@piootr](https://forum.pinegrow.com/u/piootr)\
**Post date:** [March 11, 2024, 8:14pm UTC](https://forum.pinegrow.com/t/tailwind-external-build-and-exporting-files-to-a-theme/8766/1 "2024-03-11T20:14:17Z")

</div>

Hi,

Upon setting up external compiler for Tailwind, some new files are added to the project, e.g., package.json, postcss.config.js, tailwind.config.js, source.css, etc.

These files and folders are marked as being exported to the WordPress theme, but should they all be? If not, which files should be left only for the project, and not exported to the theme?

Additionally, if I only use classic themes, no blocks whatsoever, should I care about switching to Tailwind internal compiler, e.g., to refresh tailwind\_for\_wp\_editor.css file (or any other file)?

Thanks

---

<div class="post-metadata">

**Author:** ![TechAkayy](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TechAkayy](https://forum.pinegrow.com/u/TechAkayy)\
**Post date:** [March 12, 2024, 7:37pm UTC](https://forum.pinegrow.com/t/tailwind-external-build-and-exporting-files-to-a-theme/8766/2 "2024-03-12T19:37:35Z")

</div>

Those three files `package.json, postcss.config.js, tailwind.config.js` are part of the node/build setup and are pretty much used to generate the css output. I would simply export only `source.css`. Btw, shouldn’t that be `tailwind.css` and not `source.css`, as per [pinegrow tailwind docs](https://pinegrow.com/docs/tailwind/using-external-build-process/#the-compilation-setup)?

> [@piootr](#):
>
> Additionally, if I only use classic themes, no blocks whatsoever, should I care about switching to Tailwind internal compiler, e.g., to refresh tailwind\_for\_wp\_editor.css file (or any other file)?

If you go external compiler, it’s best to stick with it. When switching from external to internal compiler, obviously, those extra features like @apply, any customization to tailwind config, tailwind plugins etc will be lost.

---

<div class="post-metadata">

**Author:** ![piootr](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@piootr](https://forum.pinegrow.com/u/piootr)\
**Post date:** [March 12, 2024, 8:26pm UTC](https://forum.pinegrow.com/t/tailwind-external-build-and-exporting-files-to-a-theme/8766/3 "2024-03-12T20:26:07Z")

</div>

> [@TechAkayy](#):
>
> Btw, shouldn’t that be `tailwind.css` and not `source.css`, as per [pinegrow tailwind docs](https://pinegrow.com/docs/tailwind/using-external-build-process/#the-compilation-setup)?

`tailwind.css` is the build output file, so I guess only this file should be exported to the final theme, not the `source.css`.

> [@TechAkayy](#):
>
> If you go external compiler, it’s best to stick with it. When switching from external to internal compiler, obviously, those extra features like @apply, any customization to tailwind config, tailwind plugins etc will be lost.

I asked about this, because this is suggested approach as per for example [this](https://peakperformancedigital.com/pinegrows-external-build-process-for-tailwind-css/) guide (cf. sections " Files Created by Pinegrow’s WordPress Module" and " WordPress Block Editor Stylesheet").

---

<div class="post-metadata">

**Author:** ![adamslowe](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/adamslowe/32/4590_2.png) [@adamslowe](https://forum.pinegrow.com/u/adamslowe)\
**Post date:** [March 12, 2024, 8:36pm UTC](https://forum.pinegrow.com/t/tailwind-external-build-and-exporting-files-to-a-theme/8766/4 "2024-03-12T20:36:45Z")

</div>

FYI: The guides on Pinegrow’s site can sometimes be a little confusing (at least they were for me) since they covered two different versions, and they differ slightly from the Tailwind docs. Here is a video I made showing the process and explaining the different files that get generated.

[![](https://img.youtube.com/vi/ZidufjA1Qww/maxresdefault.jpg "Pinegrow's External Build Process for Tailwind CSS") ](https://www.youtube.com/watch?v=ZidufjA1Qww)

---

<div class="post-metadata">

**Author:** ![piootr](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@piootr](https://forum.pinegrow.com/u/piootr)\
**Post date:** [March 12, 2024, 9:01pm UTC](https://forum.pinegrow.com/t/tailwind-external-build-and-exporting-files-to-a-theme/8766/5 "2024-03-12T21:01:10Z")

</div>

@adamslowe, thanks, I followed this guide when I was setting up external build for Tailwind, sure.  
But I couldn’t find specific info on what to export and what to leave only in the Pinegrow source project on building up the theme.

---

<div class="post-metadata">

**Author:** ![adamslowe](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/adamslowe/32/4590_2.png) [@adamslowe](https://forum.pinegrow.com/u/adamslowe)\
**Post date:** [March 12, 2024, 9:15pm UTC](https://forum.pinegrow.com/t/tailwind-external-build-and-exporting-files-to-a-theme/8766/6 "2024-03-12T21:15:59Z")

</div>

In your case, with just the theme and no blocks, all you need to copy is the tailwind.css file. None of the other files are necessary for WordPress; they are all just there to support the other pieces that generate your final CSS file.

---

<div class="post-metadata">

**Author:** ![piootr](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@piootr](https://forum.pinegrow.com/u/piootr)\
**Post date:** [March 13, 2024, 11:15am UTC](https://forum.pinegrow.com/t/tailwind-external-build-and-exporting-files-to-a-theme/8766/7 "2024-03-13T11:15:42Z")

</div>

Great, thanks @adamslowe.

---

<div class="post-metadata">

**Author:** ![msguerra74](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/msguerra74/32/6194_2.png) [@msguerra74](https://forum.pinegrow.com/u/msguerra74)\
**Post date:** [March 19, 2024, 4:53am UTC](https://forum.pinegrow.com/t/tailwind-external-build-and-exporting-files-to-a-theme/8766/8 "2024-03-19T04:53:01Z")

</div>

Are there plans to have a PG internal TW compiler that’s more configurable like the external one, or is this the choice we’ll always have to make depending on our project needs?

I’ve looked up so much stuff in the last few days that I don’t remember if I saw this answered or not. Plus, I’m not even using TW at the moment, so it’s not something I’m looking too deeply into yet, but I like to know the options and limitations for future reference.

---

<div class="post-metadata">

**Author:** ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)\
**Post date:** [March 19, 2024, 8:46am UTC](https://forum.pinegrow.com/t/tailwind-external-build-and-exporting-files-to-a-theme/8766/9 "2024-03-19T08:46:17Z")

</div>

Yes, the next update will have more configurable internal compiler as well as some other significant TW improvements.

---

<div class="post-metadata">

**Author:** ![red-rosefields](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/red-rosefields/32/5392_2.png) [@red-rosefields](https://forum.pinegrow.com/u/red-rosefields)\
**Post date:** [March 19, 2024, 2:09pm UTC](https://forum.pinegrow.com/t/tailwind-external-build-and-exporting-files-to-a-theme/8766/11 "2024-03-19T14:09:34Z")

</div>

These are excellent news!

---

<div class="post-metadata">

**Author:** ![msguerra74](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/msguerra74/32/6194_2.png) [@msguerra74](https://forum.pinegrow.com/u/msguerra74)\
**Post date:** [March 19, 2024, 2:22pm UTC](https://forum.pinegrow.com/t/tailwind-external-build-and-exporting-files-to-a-theme/8766/12 "2024-03-19T14:22:37Z")

</div>

Thanks, I can’t wait to start playing around with it!
