Skip to content

Commit

Permalink
add cloudflare
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronlifton committed Mar 5, 2024
1 parent 4460505 commit 463f769
Show file tree
Hide file tree
Showing 8 changed files with 1,032 additions and 150 deletions.
138 changes: 57 additions & 81 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,112 +1,88 @@
import { defineConfig, squooshImageService } from "astro/config";
import mdx from "@astrojs/mdx";
import sitemap from "@astrojs/sitemap";
import path, { dirname } from "path";
import { fileURLToPath } from "url";
import tailwind from "@astrojs/tailwind";
import { defineConfig, squooshImageService } from "astro/config";
import path, { dirname } from "path";
import { remarkShakuCodeAnnotate } from "remark-shaku-code-annotate";
import { fileURLToPath } from "url";
// import customImageResizerIntegration from "./processImages.mjs";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import { transformerTwoslash } from "shikiji-twoslash";
import react from "@astrojs/react";
import svelte from "@astrojs/svelte";
import bun from "astro-bun-adapter";
import icon from "astro-icon";
import react from "@astrojs/react";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import { transformerTwoslash } from "shikiji-twoslash";
import svgr from "vite-plugin-svgr";
import { remarkReadingTime } from "./src/plugins/remark-reading-time";
// import solid from "@astrojs/solid-js";
import cloudflare from "@astrojs/cloudflare";
const __dirname = dirname(fileURLToPath(import.meta.url));
import svgr from "vite-plugin-svgr";
import { remarkReadingTime } from "./src/plugins/remark-reading-time"


// https://astro.build/config
export default defineConfig({
output: "hybrid",
output: "server",
adapter: cloudflare(),
site: "https://example.com",
// prefetch: true,
integrations: [
mdx({
}),
sitemap(),
tailwind({
applyBaseStyles: false,
nesting: true,
}),
// customImageResizerIntegration,
svelte(),
icon(),
// solid({
// include: ["**/solid/*"],
// }),
react({}),
],
integrations: [mdx({}), sitemap(), tailwind({
applyBaseStyles: false,
nesting: true
}),
// customImageResizerIntegration,
svelte(), icon(),
// solid({
// include: ["**/solid/*"],
// }),
react({})],
markdown: {
remarkPlugins: [
remarkReadingTime,
[
remarkShakuCodeAnnotate,
{
fallbackToShiki: true,
theme: "material-theme-darker",
offset: "2",
lang: ["tsx", "jsx", "typescript", "sh", "fish", "json"],
},
],
],
rehypePlugins: [
[
rehypeAutolinkHeadings,
{
behavior: "append",
},
],
],
remarkPlugins: [remarkReadingTime, [remarkShakuCodeAnnotate, {
fallbackToShiki: true,
theme: "material-theme-darker",
offset: "2",
lang: ["tsx", "jsx", "typescript", "sh", "fish", "json"]
}]],
rehypePlugins: [[rehypeAutolinkHeadings, {
behavior: "append"
}]],
shikiConfig: {
theme: "material-theme-darker",
transformers: [
(node) => {
if (node.type === "element" && node.tagName === "pre") {
const tabIndexNode = node.getAttributeNode("tabIndex");
node.removeAttributeNode(tabIndexNode);
}
return node;
},
transformerTwoslash(),
],
transformers: [node => {
if (node.type === "element" && node.tagName === "pre") {
const tabIndexNode = node.getAttributeNode("tabIndex");
node.removeAttributeNode(tabIndexNode);
}
return node;
}, transformerTwoslash()]
},
extendDefaultPlugins: true,
extendDefaultPlugins: true
},
vite: {
ssr: {
noExternal: ["@radix-ui/react-tabs"],
noExternal: ["@radix-ui/react-tabs"]
},
resolve: {
alias: {
$: path.resolve(__dirname, "./src"),
},
$: path.resolve(__dirname, "./src")
}
},
plugins: [
svgr({
include: "**/*.svg?react",
svgrOptions: {
plugins: ["@svgr/plugin-svgo", "@svgr/plugin-jsx"],
svgoConfig: {
plugins: [
"preset-default",
"removeTitle",
"removeDesc",
"removeDoctype",
"cleanupIds",
],
},
},
}),
],
plugins: [svgr({
include: "**/*.svg?react",
svgrOptions: {
plugins: ["@svgr/plugin-svgo", "@svgr/plugin-jsx"],
svgoConfig: {
plugins: ["preset-default", "removeTitle", "removeDesc", "removeDoctype", "cleanupIds"]
}
}
})]
},
image: {
service: squooshImageService(),
service: squooshImageService()
},
redirects: {
"/blog": {
status: 308,
destination: "/blog/1",
},
},
});
destination: "/blog/1"
}
}
});
Binary file modified bun.lockb
Binary file not shown.
Loading

0 comments on commit 463f769

Please sign in to comment.