@fullstacked/tailwindcss 4.3.2-patch.2 → 4.3.2-patch.3
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.js +4 -7
- package/index.ts +5 -8
- package/package.json +3 -2
package/index.js
CHANGED
|
@@ -15,7 +15,6 @@ export function initialize(opts) {
|
|
|
15
15
|
oxide: oxide(fs.promises.readFile(oxidePath)),
|
|
16
16
|
lightningcss: lightningcss(lightningcssPath),
|
|
17
17
|
tailwindcss: tailwindcssPath,
|
|
18
|
-
baseDirectory: opts?.baseDirectory || process.cwd(),
|
|
19
18
|
skipLightning: opts?.skipLightning
|
|
20
19
|
};
|
|
21
20
|
await Promise.all([locations.oxide, locations.lightningcss]);
|
|
@@ -69,12 +68,9 @@ async function loadStylesheet(id, base) {
|
|
|
69
68
|
throw new Error(`The browser build does not support @import for "${id}"`);
|
|
70
69
|
}
|
|
71
70
|
async function compileTailwind(entryfile, files) {
|
|
72
|
-
entryfile = path.join(init.baseDirectory, entryfile);
|
|
73
71
|
const entry = await fs.promises.readFile(entryfile, "utf-8");
|
|
74
72
|
const contents = await Promise.all(
|
|
75
|
-
files.map(
|
|
76
|
-
(file) => fs.promises.readFile(path.join(init.baseDirectory, file), "utf-8")
|
|
77
|
-
)
|
|
73
|
+
files.map((file) => fs.promises.readFile(file, "utf-8"))
|
|
78
74
|
);
|
|
79
75
|
const candidate = contents.map((content) => extract(content)).flat();
|
|
80
76
|
const compiler = await compile(entry, { loadStylesheet });
|
|
@@ -91,8 +87,9 @@ async function tailwindBuilder(params) {
|
|
|
91
87
|
}
|
|
92
88
|
const sources = params.sources.filter((s) => !s.endsWith(".css"));
|
|
93
89
|
await initialize(params.initializeOptions);
|
|
94
|
-
const
|
|
95
|
-
const
|
|
90
|
+
const entryfile = params.resolved.at(0).importer;
|
|
91
|
+
const css = await compileTailwind(entryfile, sources);
|
|
92
|
+
const basename = path.basename(entryfile);
|
|
96
93
|
return [
|
|
97
94
|
{
|
|
98
95
|
outputName: basename + ".tailwind.css",
|
package/index.ts
CHANGED
|
@@ -111,9 +111,7 @@ async function compileTailwind(
|
|
|
111
111
|
): Promise<string> {
|
|
112
112
|
const entry = await fs.promises.readFile(entryfile, "utf-8");
|
|
113
113
|
const contents = await Promise.all(
|
|
114
|
-
files.map((file) =>
|
|
115
|
-
fs.promises.readFile(file, "utf-8")
|
|
116
|
-
)
|
|
114
|
+
files.map((file) => fs.promises.readFile(file, "utf-8"))
|
|
117
115
|
);
|
|
118
116
|
const candidate = contents.map((content) => extract(content)).flat();
|
|
119
117
|
const compiler = await compile(entry, { loadStylesheet });
|
|
@@ -122,9 +120,9 @@ async function compileTailwind(
|
|
|
122
120
|
const result = init.skipLightning
|
|
123
121
|
? css
|
|
124
122
|
: transform({
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
filename: "input.css",
|
|
124
|
+
code: new TextEncoder().encode(css)
|
|
125
|
+
}).code;
|
|
128
126
|
|
|
129
127
|
return typeof result === "string"
|
|
130
128
|
? result
|
|
@@ -143,8 +141,7 @@ async function tailwindBuilder(params: {
|
|
|
143
141
|
return [];
|
|
144
142
|
}
|
|
145
143
|
|
|
146
|
-
const sources = params.sources
|
|
147
|
-
.filter((s) => !s.endsWith(".css"));
|
|
144
|
+
const sources = params.sources.filter((s) => !s.endsWith(".css"));
|
|
148
145
|
await initialize(params.initializeOptions);
|
|
149
146
|
const entryfile = params.resolved.at(0).importer;
|
|
150
147
|
const css = await compileTailwind(entryfile, sources);
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstacked/tailwindcss",
|
|
3
|
-
"version": "4.3.2-patch.
|
|
3
|
+
"version": "4.3.2-patch.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "esbuild --outfile=index.js index.ts"
|
|
6
|
+
"build": "esbuild --outfile=index.js index.ts",
|
|
7
|
+
"prepack": "npm run build"
|
|
7
8
|
},
|
|
8
9
|
"dependencies": {
|
|
9
10
|
"lightningcss-wasm": "^1.32.0",
|