brisa-tailwindcss 0.1.7-canary.3 → 0.1.7-canary.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +5 -1
- package/index.ts +4 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
type Config = {
|
2
|
+
embedded?: boolean;
|
3
|
+
};
|
4
|
+
|
1
5
|
/**
|
2
6
|
* To properly integrate TailwindCSS, you have to add the following code to
|
3
7
|
* your `brisa.config.ts` file:
|
@@ -12,7 +16,7 @@
|
|
12
16
|
*
|
13
17
|
* - [Docs](https://brisa.build/building-your-application/integrations/tailwind-css#integrating-tailwind-css)
|
14
18
|
*/
|
15
|
-
export default function tailwindCSS(): {
|
19
|
+
export default function tailwindCSS(config?: Config): {
|
16
20
|
name: string;
|
17
21
|
transpileCSS(pathname: string, content: string): Promise<string>;
|
18
22
|
defaultCSS: {
|
package/index.ts
CHANGED
@@ -4,8 +4,10 @@ import fs from 'node:fs/promises';
|
|
4
4
|
import path from 'node:path';
|
5
5
|
import libs from './libs.json';
|
6
6
|
|
7
|
+
const defaultConfig = { embedded: true };
|
8
|
+
|
7
9
|
// Note: is not bundled here to avoid issues with lightningcss
|
8
|
-
export default function brisaTailwindcss() {
|
10
|
+
export default function brisaTailwindcss({ embedded = true } = defaultConfig) {
|
9
11
|
return {
|
10
12
|
name: 'brisa-tailwindcss',
|
11
13
|
async transpileCSS(pathname: string, content: string) {
|
@@ -30,6 +32,7 @@ export default function brisaTailwindcss() {
|
|
30
32
|
// work correctly. As a solution, we install tailwind in the build folder and in this way the problem is solved.
|
31
33
|
// Issue: https://github.com/brisa-build/brisa/issues/637
|
32
34
|
async afterBuild({ BUILD_DIR, LOG_PREFIX }) {
|
35
|
+
if (!embedded) return;
|
33
36
|
const start = Date.now();
|
34
37
|
const destNodeModules = path.join(BUILD_DIR, 'node_modules');
|
35
38
|
const nodeModules = Bun.resolveSync('brisa', BUILD_DIR).split('brisa')[0];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "brisa-tailwindcss",
|
3
|
-
"version": "0.1.7-canary.
|
3
|
+
"version": "0.1.7-canary.4",
|
4
4
|
"license": "MIT",
|
5
5
|
"type": "module",
|
6
6
|
"main": "./index.ts",
|
@@ -29,9 +29,9 @@
|
|
29
29
|
"postcss": "8.4.48",
|
30
30
|
"tailwindcss": "4.0.0-alpha.33"
|
31
31
|
},
|
32
|
-
"packageManager": "bun@1.1.
|
32
|
+
"packageManager": "bun@1.1.38",
|
33
33
|
"engines": {
|
34
|
-
"bun": ">= 1.1.
|
34
|
+
"bun": ">= 1.1.38",
|
35
35
|
"npm": ">= 10.0.0",
|
36
36
|
"yarn": ">= 3.0.0",
|
37
37
|
"pnpm": ">= 9.8.0"
|