From f3040e9d57e14eb842c2075492fbd354ffa32f0d Mon Sep 17 00:00:00 2001 From: Mehdi Vasigh Date: Sat, 22 May 2021 16:54:00 -0500 Subject: [PATCH] remove mdsvex.config.cjs and use ES module version --- mdsvex.config.cjs | 19 ------------------- mdsvex.config.js | 32 +++++++++++++++++++++++++++++--- svelte.config.js | 2 +- 3 files changed, 30 insertions(+), 23 deletions(-) delete mode 100644 mdsvex.config.cjs diff --git a/mdsvex.config.cjs b/mdsvex.config.cjs deleted file mode 100644 index 43eed05..0000000 --- a/mdsvex.config.cjs +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = { - extensions: [".svelte.md", ".md", ".svx"], - smartypants: { - dashes: "oldschool", - }, - remarkPlugins: [ - [require("remark-github"), { - // Use your own repository - repository: "https://github.com/svelte-add/mdsvex.git", - }], - require("remark-abbr"), - ], - rehypePlugins: [ - require("rehype-slug"), - [require("rehype-autolink-headings"), { - behavior: "wrap", - }], - ], -}; diff --git a/mdsvex.config.js b/mdsvex.config.js index 9aee9fd..39d1bd6 100644 --- a/mdsvex.config.js +++ b/mdsvex.config.js @@ -1,4 +1,30 @@ -import { createRequire } from "module"; -const require = createRequire(import.meta.url) +import remarkGithub from 'remark-github'; +import remarkAbbr from 'remark-abbr'; +import rehypeSlug from 'rehype-slug'; +import rehypeAutolinkHeadings from 'rehype-autolink-headings'; -export const mdsvexConfig = require("./mdsvex.config.cjs"); +export default { + extensions: ['.svelte.md', '.md', '.svx'], + smartypants: { + dashes: 'oldschool' + }, + remarkPlugins: [ + [ + remarkGithub, + { + // Use your own repository + repository: 'https://github.com/mvasigh/sveltekit-mdsvex-blog.git' + } + ], + remarkAbbr + ], + rehypePlugins: [ + rehypeSlug, + [ + rehypeAutolinkHeadings, + { + behavior: 'wrap' + } + ] + ] +}; diff --git a/svelte.config.js b/svelte.config.js index 7f67492..779b7e8 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,6 +1,6 @@ import adapter from '@sveltejs/adapter-static'; import md from 'mdsvex'; -import { mdsvexConfig } from './mdsvex.config.js'; +import mdsvexConfig from './mdsvex.config.js'; /** @type {import('@sveltejs/kit').Config} */ const config = {