-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
eca80d0
commit b81139e
Showing
12 changed files
with
275 additions
and
161 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 |
---|---|---|
@@ -1,32 +1,15 @@ | ||
const path = require("path"); | ||
const loadConfig = require("tailwindcss/loadConfig"); | ||
|
||
/** @type {import("tailwindcss").Config | null} */ | ||
let _tailwindConfig = null; | ||
/** | ||
* Transpiles tailwind.config.ts for babel | ||
* Fix until nativewind babel plugin supports tailwind.config.ts files | ||
*/ | ||
function lazyLoadConfig() { | ||
return ( | ||
_tailwindConfig ?? loadConfig(path.join(__dirname, "tailwind.config.ts")) | ||
); | ||
} | ||
|
||
/** @type {import("@babel/core").ConfigFunction} */ | ||
module.exports = function (api) { | ||
api.cache.forever(); | ||
|
||
return { | ||
presets: ["babel-preset-expo"], | ||
presets: [ | ||
["babel-preset-expo", { jsxImportSource: "nativewind" }], | ||
"nativewind/babel", | ||
], | ||
plugins: [ | ||
[ | ||
"nativewind/babel", | ||
{ | ||
tailwindConfig: lazyLoadConfig(), | ||
}, | ||
], | ||
require.resolve("expo-router/babel"), | ||
require.resolve("react-native-reanimated/plugin"), | ||
], | ||
}; | ||
}; |
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
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,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
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 @@ | ||
/// <reference types="nativewind/types" /> |
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,8 +1,10 @@ | ||
// @ts-expect-error - no types | ||
import nativewind from "nativewind/preset"; | ||
import type { Config } from "tailwindcss"; | ||
|
||
import baseConfig from "@acme/tailwind-config"; | ||
|
||
export default { | ||
content: ["./src/**/*.{ts,tsx}"], | ||
presets: [baseConfig], | ||
presets: [baseConfig, nativewind], | ||
} satisfies Config; |
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,2 +1,6 @@ | ||
// @ts-expect-error - No types for postcss | ||
module.exports = require("@acme/tailwind-config/postcss"); | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
}; |
Oops, something went wrong.