Skip to content

Commit 4313f2a

Browse files
committed
πŸ› FIX: Build
1 parent ad85fcd commit 4313f2a

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

β€Žapps/baseai.dev/src/mdx/languages.mjsβ€Ž

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
import langGraphQL from 'shiki/languages/graphql.tmLanguage.json' assert { type: 'json' };
2-
import langJS from 'shiki/languages/javascript.tmLanguage.json' assert { type: 'json' };
3-
import langJSX from 'shiki/languages/jsx.tmLanguage.json' assert { type: 'json' };
4-
import langJSON from 'shiki/languages/json.tmLanguage.json' assert { type: 'json' };
5-
import langXML from 'shiki/languages/xml.tmLanguage.json' assert { type: 'json' };
6-
import langYAML from 'shiki/languages/yaml.tmLanguage.json' assert { type: 'json' };
7-
import langPHP from 'shiki/languages/php.tmLanguage.json' assert { type: 'json' };
8-
import langHTML from 'shiki/languages/html.tmLanguage.json' assert { type: 'json' };
9-
import langCSS from 'shiki/languages/css.tmLanguage.json' assert { type: 'json' };
10-
import langSCSS from 'shiki/languages/scss.tmLanguage.json' assert { type: 'json' };
11-
import langSASS from 'shiki/languages/sass.tmLanguage.json' assert { type: 'json' };
12-
import langLESS from 'shiki/languages/less.tmLanguage.json' assert { type: 'json' };
13-
import langMarkdown from 'shiki/languages/markdown.tmLanguage.json' assert { type: 'json' };
14-
import langTS from 'shiki/languages/typescript.tmLanguage.json' assert { type: 'json' };
15-
import langTSX from 'shiki/languages/tsx.tmLanguage.json' assert { type: 'json' };
16-
import langShell from 'shiki/languages/shellscript.tmLanguage.json' assert { type: 'json' };
17-
import langPy from 'shiki/languages/python.tmLanguage.json' assert { type: 'json' };
1+
import { createRequire } from 'module';
2+
3+
const require = createRequire(import.meta.url);
4+
const langGraphQL = require('shiki/languages/graphql.tmLanguage.json');
5+
const langJS = require('shiki/languages/javascript.tmLanguage.json');
6+
const langJSX = require('shiki/languages/jsx.tmLanguage.json');
7+
const langJSON = require('shiki/languages/json.tmLanguage.json');
8+
const langXML = require('shiki/languages/xml.tmLanguage.json');
9+
const langYAML = require('shiki/languages/yaml.tmLanguage.json');
10+
const langPHP = require('shiki/languages/php.tmLanguage.json');
11+
const langHTML = require('shiki/languages/html.tmLanguage.json');
12+
const langCSS = require('shiki/languages/css.tmLanguage.json');
13+
const langSCSS = require('shiki/languages/scss.tmLanguage.json');
14+
const langSASS = require('shiki/languages/sass.tmLanguage.json');
15+
const langLESS = require('shiki/languages/less.tmLanguage.json');
16+
const langMarkdown = require('shiki/languages/markdown.tmLanguage.json');
17+
const langTS = require('shiki/languages/typescript.tmLanguage.json');
18+
const langTSX = require('shiki/languages/tsx.tmLanguage.json');
19+
const langShell = require('shiki/languages/shellscript.tmLanguage.json');
20+
const langPy = require('shiki/languages/python.tmLanguage.json');
1821

1922
const lang = [
2023
{

β€Žapps/baseai.dev/src/mdx/rehype.mjsβ€Ž

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
import { createRequire } from 'module';
12
import { slugifyWithCounter } from '@sindresorhus/slugify';
23
import * as acorn from 'acorn';
34
import { toString } from 'mdast-util-to-string';
45
import { mdxAnnotations } from 'mdx-annotations';
56
import shiki from 'shiki';
67
import { visit } from 'unist-util-visit';
7-
import theme from './themes/shades-of-purple.json' assert { type: 'json' };
88
import lang from './languages.mjs';
99

10+
const require = createRequire(import.meta.url);
11+
const theme = require('./themes/shades-of-purple.json');
12+
1013
export function rehypeParseCodeBlocks() {
1114
return tree => {
1215
visit(tree, 'element', (node, _nodeIndex, parentNode) => {

0 commit comments

Comments
Β (0)