Skip to content

Commit

Permalink
Cache tailwind re-builds using broccoli-caching-writer
Browse files Browse the repository at this point in the history
If no changes were made to any js/css files inside the `tailwind`
directory, return previously cached build.
  • Loading branch information
xomaczar authored and samselikoff committed Oct 31, 2018
1 parent e1e35da commit 889bb8e
Show file tree
Hide file tree
Showing 3 changed files with 1,216 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/build-tailwind.js
@@ -1,6 +1,6 @@
'use strict';

const BroccoliPlugin = require('broccoli-plugin');
const BroccoliPlugin = require('broccoli-caching-writer');
const path = require('path');
const fs = require('fs-extra');
const postcss = require('postcss');
Expand Down Expand Up @@ -37,7 +37,8 @@ module.exports = function(addon) {
});

return new BuildTailwindPlugin([ inputPath, tailwindConfigTree ], {
srcFile: 'modules.css'
srcFile: 'modules.css',
cacheInclude: [/.*\.(js|css)$/]
});
}

Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -25,6 +25,7 @@
"prepare": "./scripts/link-them.sh"
},
"dependencies": {
"broccoli-caching-writer": "^3.0.3",
"broccoli-funnel": "^2.0.1",
"broccoli-merge-trees": "^3.0.1",
"broccoli-plugin": "^1.3.0",
Expand Down

0 comments on commit 889bb8e

Please sign in to comment.