-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e21f62
commit efd7e0e
Showing
8 changed files
with
411 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,5 @@ yarn-debug.log* | |
.pnp.js | ||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
frontend/styles/jit-refresh.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class Builders::TailwindJit < SiteBuilder | ||
def build | ||
hook :site, :pre_reload do |_, paths| | ||
# Skip if paths are not defined (e.g: from console reload) | ||
next unless paths | ||
|
||
# Don't trigger refresh if it's a frontend-only change | ||
next if paths.length == 1 && paths.first.ends_with?("manifest.json") | ||
|
||
# Save out a comment file to trigger Tailwind's JIT | ||
refresh_file = site.in_root_dir("frontend", "styles", "jit-refresh.css") | ||
File.write refresh_file, "/* #{Time.now.to_i} */" | ||
throw :halt # don't continue the build, wait for watcher rebuild | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
module.exports = { | ||
module.exports = { | ||
plugins: { | ||
'tailwindcss': {}, | ||
'postcss-flexbugs-fixes': {}, | ||
'postcss-preset-env': { | ||
autoprefixer: { | ||
flexbox: 'no-2009' | ||
}, | ||
stage: 3 | ||
stage: 2 | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
module.exports = { | ||
content: [ | ||
'./src/**/*.{html,md,liquid,erb,serb,rb}', | ||
'./frontend/javascript/**/*.js', | ||
], | ||
theme: { | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
} | ||
|
Oops, something went wrong.