Skip to content

Commit

Permalink
install mdx-js/rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
nasubi916 committed Apr 6, 2024
1 parent 09c7de7 commit 05fa493
Show file tree
Hide file tree
Showing 7 changed files with 957 additions and 6 deletions.
8 changes: 8 additions & 0 deletions articles/test.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# markdown test

ほしいものリスト

- test
- aa
- dfd
- let
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"@mantine/charts": "^7.7.0",
"@mantine/core": "^7.6.2",
"@mantine/hooks": "^7.6.2",
"@mdx-js/react": "^3.0.1",
"@mdx-js/rollup": "^3.0.1",
"@nanostores/react": "^0.7.2",
"nanostores": "^0.10.0",
"react": "^18.2.0",
Expand Down
Binary file removed src/assets/bom.png
Binary file not shown.
Empty file added src/pages/blogs/+Layout.tsx
Empty file.
19 changes: 19 additions & 0 deletions src/pages/blogs/+Page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { useEffect, useReducer, type ReactElement } from "react";
import { MDXProvider } from "@mdx-js/react";
import Test from "../../../articles/test.mdx";

/** @type {import('mdx/types.js').MDXComponents} */
const components = {
em(properties: any) {
return <i {...properties} />;
},
};
export default function Blogs(): ReactElement {
return (
<div>
<h1>Blogs</h1>

<Test components={components} />
</div>
);
}
8 changes: 7 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { defineConfig } from "vite";
import mdx from '@mdx-js/rollup'
import react from "@vitejs/plugin-react-swc";
import vike from "vike/plugin";
import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig({
plugins: [react(), vike({ prerender: true }), tsconfigPaths()],
plugins: [
react(),
tsconfigPaths(),
vike({ prerender: true }),
{enforce: 'pre', ...mdx()},
],
});
926 changes: 921 additions & 5 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 05fa493

Please sign in to comment.