Clean up require -> import

This commit is contained in:
Tuan Cao 2022-04-05 10:45:30 +07:00
parent 36dcfbb2bc
commit d9923053f5

View File

@ -1,23 +1,13 @@
import matter from 'gray-matter' import matter from 'gray-matter'
import path from 'path' import path from 'path'
import fs from "fs" import fs from "fs"
var remark = require('remark') import unified from "unified";
//import remark2react from 'remark-react' import markdown from "remark-parse";
import {wikiLinkPlugin} from "remark-wiki-link";
var remark2react = require("remark-react"); import html from "remark-html";
const unified = require('unified') import frontmatter from "remark-frontmatter";
const markdown = require('remark-parse') import externalLinks from "remark-external-links";
const { wikiLinkPlugin } = require('remark-wiki-link'); import highlight from "remark-highlight.js";
var guide = require('remark-preset-lint-markdown-style-guide')
var html = require('remark-html')
var report = require('vfile-reporter')
var vfile = require('to-vfile')
var frontmatter = require('remark-frontmatter')
var stringify = require('remark-stringify')
var externalLinks = require('remark-external-links')
const highlight = require('remark-highlight.js')
const postsDirectory = path.join(process.cwd(), 'posts') const postsDirectory = path.join(process.cwd(), 'posts')
const isFile = fileName => { const isFile = fileName => {
@ -73,7 +63,8 @@ export const Transformer = {
}, },
aliasDivider:"|" aliasDivider:"|"
}).use(html) })
.use(html)
.process(sanitizedContent, .process(sanitizedContent,
function (err, file) { function (err, file) {
//console.log("asd", String(file).slice(0,50)) //console.log("asd", String(file).slice(0,50))