Skip to content

Commit

Permalink
next config resolve alias for monaco
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoLuglio committed Sep 28, 2024
1 parent 6be4b76 commit 1881af8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 25 deletions.
Binary file modified bun.lockb
Binary file not shown.
15 changes: 11 additions & 4 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "export",
output: 'export',
// basePath: "/vscode-theme-generator",
basePath:
process.env.NODE_ENV === "production" ? "/vscode-theme-generator" : "",
process.env.NODE_ENV === 'production' ? '/vscode-theme-generator' : '',
images: {
unoptimized: true,
},
};
experimental: {
turbo: {
resolveAlias: {
'monaco-editor': 'monaco-editor/esm/vs/editor/editor.api',
},
},
},
}

export default nextConfig;
export default nextConfig
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"lucide-react": "^0.438.0",
"monaco-editor": "^0.52.0",
"monaco-editor-textmate": "^4.0.0",
"monaco-editor-webpack-plugin": "^7.1.0",
"monaco-textmate": "^3.0.1",
"next": "15.0.0-rc.0",
"next-themes": "^0.3.0",
Expand Down
20 changes: 0 additions & 20 deletions src/components/ThemePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -620,26 +620,6 @@ const ThemePreview: React.FC = () => {
}
}, [])

function getTokenType(token: string, defaultType: string): string[] {
if (/^[A-Z][a-zA-Z]*$/.test(token)) {
return ['support.class.tsx']
} else if (/^[a-z]+$/.test(token)) {
return ['entity.name.tag.tsx']
} else if (/^[<>\/]$/.test(token)) {
return ['punctuation.definition.tag.tsx']
} else if (/^["']/.test(token)) {
return ['string.tsx']
} else if (/^\d+$/.test(token)) {
return ['constant.numeric.tsx']
} else if (
/^(const|let|var|function|return|import|from|export)$/.test(token)
) {
return ['keyword.control.tsx']
} else {
return [defaultType || 'source.tsx']
}
}

useEffect(() => {
if (isEditorReady && editorRef.current) {
updateTheme()
Expand Down

0 comments on commit 1881af8

Please sign in to comment.