fix(init): only add tailwind to imports when selected (#3051)
If you don't install tailwind you shouldn't need the plugin, resolves https://github.com/denoland/fresh/issues/3050
This commit is contained in:
+2
-2
@@ -530,8 +530,6 @@ if (Deno.args.includes("build")) {
|
|||||||
exclude: ["**/_fresh/*"],
|
exclude: ["**/_fresh/*"],
|
||||||
imports: {
|
imports: {
|
||||||
"fresh": `jsr:@fresh/core@^${FRESH_VERSION}`,
|
"fresh": `jsr:@fresh/core@^${FRESH_VERSION}`,
|
||||||
"@fresh/plugin-tailwind":
|
|
||||||
`jsr:@fresh/plugin-tailwind@^${FRESH_TAILWIND_VERSION}`,
|
|
||||||
"preact": `npm:preact@^${PREACT_VERSION}`,
|
"preact": `npm:preact@^${PREACT_VERSION}`,
|
||||||
"@preact/signals": `npm:@preact/signals@^${PREACT_SIGNALS_VERSION}`,
|
"@preact/signals": `npm:@preact/signals@^${PREACT_SIGNALS_VERSION}`,
|
||||||
} as Record<string, string>,
|
} as Record<string, string>,
|
||||||
@@ -552,6 +550,8 @@ if (Deno.args.includes("build")) {
|
|||||||
|
|
||||||
if (useTailwind) {
|
if (useTailwind) {
|
||||||
denoJson.imports["tailwindcss"] = "npm:tailwindcss@^3.4.3";
|
denoJson.imports["tailwindcss"] = "npm:tailwindcss@^3.4.3";
|
||||||
|
denoJson.imports["@fresh/plugin-tailwind"] =
|
||||||
|
`jsr:@fresh/plugin-tailwind@^${FRESH_TAILWIND_VERSION}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
await writeFile("deno.json", denoJson);
|
await writeFile("deno.json", denoJson);
|
||||||
|
|||||||
Reference in New Issue
Block a user