Skip to content

Commit

Permalink
ignore if not found
Browse files Browse the repository at this point in the history
in case of invalid config or running on test env
  • Loading branch information
leandrocp committed Aug 1, 2024
1 parent 69aee17 commit 3a0cbbe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
16 changes: 12 additions & 4 deletions assets/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,24 @@ export default {
// See your `CoreComponents.icon/1` for more information.
//
plugin(function ({ matchComponents, theme }) {
let values = {}
let iconsDir = null

// Copy from host app deps.
let iconsDir = path.join(__dirname, "../../heroicons/optimized")
let hostIconsDir = path.join(__dirname, "../../heroicons/optimized")

// Copy from release.
// Adjust for Umbrella apps. See the Heroicons guide for more info.
if (!fs.existsSync(iconsDir)) {
iconsDir = path.join(__dirname, "../../../vendor/heroicons/optimized")
let releaseIconsDir = path.join(__dirname, "../../../vendor/heroicons/optimized")

if (fs.existsSync(hostIconsDir)) {
iconsDir = hostIconsDir
} else if (fs.existsSync(releaseIconsDir)) {
iconsDir = releaseIconsDir
} else {
return matchComponents({ hero: ({ _name, _fullPath }) => {} }, { values })
}

let values = {}
let icons = [
["", "/24/outline"],
["-solid", "/24/solid"],
Expand Down
15 changes: 11 additions & 4 deletions priv/tailwind.config.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -8266,11 +8266,18 @@ var tailwind_config_default = {
// See your `CoreComponents.icon/1` for more information.
//
plugin(function({ matchComponents, theme }) {
let iconsDir = path.join(__dirname, "../../heroicons/optimized");
if (!fs.existsSync(iconsDir)) {
iconsDir = path.join(__dirname, "../../../vendor/heroicons/optimized");
}
let values = {};
let iconsDir = null;
let hostIconsDir = path.join(__dirname, "../../heroicons/optimized");
let releaseIconsDir = path.join(__dirname, "../../../vendor/heroicons/optimized");
if (fs.existsSync(hostIconsDir)) {
iconsDir = hostIconsDir;
} else if (fs.existsSync(releaseIconsDir)) {
iconsDir = releaseIconsDir;
} else {
return matchComponents({ hero: ({ _name, _fullPath }) => {
} }, { values });
}
let icons = [
["", "/24/outline"],
["-solid", "/24/solid"],
Expand Down

0 comments on commit 3a0cbbe

Please sign in to comment.