-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.ts
40 lines (31 loc) · 1.13 KB
/
next.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import type { NextConfig } from "next";
import MonacoWebpackPlugin from "monaco-editor-webpack-plugin";
//import path from "path";
// Ensure dotenv is loaded
require("dotenv").config();
const nextConfig: NextConfig = {
experimental: {
esmExternals: true,
},
env: {
NEXT_PUBLIC_API_BASE_URL: process.env.NEXT_PUBLIC_API_BASE_URL,
},
webpack(config, { isServer }) {
// Only apply the plugin in client-side builds
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
};
config.plugins.push(
new MonacoWebpackPlugin({
languages: ['python', 'java', 'javascript', 'csharp', 'cpp', 'ruby', 'rust', 'typescript', 'go', 'kotlin', 'graphql'], // Add other languages you need, e.g. 'javascript', 'typescript', etc.
features: [ '!colorPicker', '!fontZoom', '!gotoSymbol', '!snippet', '!wordHighlighter'], // Add other features you need, e.g. 'accessibilityHelp', 'colorPicker', 'fontZoom', 'gotoSymbol', 'snippets', 'wordHighlighter'
})
);
}
return config;
},
};
export default nextConfig;