Skip to content

Commit

Permalink
Merge pull request #395 from ably/fix-tailwind-src-paths
Browse files Browse the repository at this point in the history
[WEB-3840] Fix Tailwind `src` paths
  • Loading branch information
jamiehenson authored Jun 27, 2024
2 parents 9e41068 + ed0323f commit 658caec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ably/ui",
"version": "14.1.0",
"version": "14.1.1",
"description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
content: ["./src/**/*.{js,json,css,ts,tsx,mdx}"],
content: ["./src/**/*.{js,ts,tsx,mdx}"],
safelist: [
"w-1/2",
"w-1/3",
Expand Down
19 changes: 7 additions & 12 deletions tailwind.extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@ const path = require("path");

const ablyUiConfigPath = path.dirname(require.resolve("./tailwind.config.js"));

const ablyUItailwindConfig = (extend) => {
// Create absolute paths to templates in AblyUI
const addPurgeContentPaths = () => {
const paths = ["*.html.erb", "*", "*.js", "*.json"].map((fileGlob) =>
path.join(ablyUiConfigPath, "src", "**", fileGlob),
);

return paths;
};

const ablyUITailwindConfig = (extend) => {
// Create absolute paths to built assets (core, reset) in AblyUI, set as content source
const configWithPlugin = {
...ablyUIConfig,
content: addPurgeContentPaths(),
content: [
path.join(ablyUiConfigPath, "core", "**", "*.js"),
path.join(ablyUiConfigPath, "reset", "**", "*.js"),
],
};

return extend(configWithPlugin);
};

module.exports = ablyUItailwindConfig;
module.exports = ablyUITailwindConfig;

0 comments on commit 658caec

Please sign in to comment.