mirror of https://github.com/buster-so/buster.git
shiki with proper transpilation
This commit is contained in:
parent
10be9b41b7
commit
3520bd9111
|
@ -72,6 +72,8 @@ const createCspHeader = (isEmbed = false) => {
|
|||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
reactStrictMode: false,
|
||||
// Transpile ESM packages
|
||||
transpilePackages: ['shiki'],
|
||||
// ESLint configuration
|
||||
eslint: {
|
||||
ignoreDuringBuilds: false,
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import React, { useEffect, useState, useRef } from 'react';
|
||||
'use client';
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { cn } from '@/lib/classMerge';
|
||||
import { getCodeTokens } from './shiki-instance';
|
||||
import styles from './SyntaxHighlighter.module.css';
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { createHighlighterCore, HighlighterCore } from 'shiki/core';
|
||||
import type { ShikiTransformer } from 'shiki';
|
||||
'use client';
|
||||
|
||||
import type { ShikiTransformer, HighlighterCore } from 'shiki';
|
||||
import { createHighlighterCore } from 'shiki/core';
|
||||
import { createOnigurumaEngine } from 'shiki/engine/oniguruma';
|
||||
import githubLight from '@shikijs/themes/github-light';
|
||||
import githubDark from '@shikijs/themes/github-dark';
|
||||
|
|
Loading…
Reference in New Issue