weifuwu 0.18.5 → 0.18.8

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/cli.ts CHANGED
@@ -32,7 +32,7 @@ async function cmdInit(name: string) {
32
32
  await mkdir(targetDir, { recursive: true })
33
33
 
34
34
  // Copy code templates
35
- const templateDir = join(__dirname, 'cli', 'template')
35
+ const templateDir = join(pkgRoot, 'cli', 'template')
36
36
  await cp(templateDir, targetDir, { recursive: true })
37
37
 
38
38
  // Write config files
package/dist/cli.js CHANGED
@@ -26,7 +26,7 @@ async function cmdInit(name) {
26
26
  const v = pkg.version;
27
27
  const depVer = (depName) => `^${pkg.devDependencies[depName].replace(/^\^/, "")}`;
28
28
  await mkdir(targetDir, { recursive: true });
29
- const templateDir = join(__dirname, "cli", "template");
29
+ const templateDir = join(pkgRoot, "cli", "template");
30
30
  await cp(templateDir, targetDir, { recursive: true });
31
31
  await writeFile(join(targetDir, "package.json"), JSON.stringify({
32
32
  name,
package/dist/index.js CHANGED
@@ -5470,7 +5470,8 @@ function ssr(path2) {
5470
5470
  base,
5471
5471
  isDev,
5472
5472
  bundle,
5473
- loaderData
5473
+ loaderData,
5474
+ compiledTailwindCss: ctx.compiledTailwindCss
5474
5475
  });
5475
5476
  });
5476
5477
  });
@@ -8161,8 +8162,10 @@ function tailwind(cssPath, scanDir2) {
8161
8162
  let twWatcher = null;
8162
8163
  return async (req, ctx, next) => {
8163
8164
  const url = new URL(req.url);
8165
+ if (!compiledCss) {
8166
+ compiledCss = await compile(cssPath, scanDir2);
8167
+ }
8164
8168
  if (url.pathname === "/__wfw/style.css") {
8165
- if (!compiledCss) compiledCss = await compile(cssPath, scanDir2);
8166
8169
  return new Response(compiledCss || "", {
8167
8170
  headers: { "content-type": "text/css; charset=utf-8" }
8168
8171
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weifuwu",
3
- "version": "0.18.5",
3
+ "version": "0.18.8",
4
4
  "description": "Web-standard HTTP framework for Node.js — (req, ctx) => Response",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",