mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-07 20:10:08 +00:00
Feat: support oceanbase monaco plugin (#1386)
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
|
||||
const path = require('path');
|
||||
const nextConfig = {
|
||||
output: 'export',
|
||||
experimental: {
|
||||
@@ -12,6 +15,30 @@ const nextConfig = {
|
||||
},
|
||||
trailingSlash: true,
|
||||
images: { unoptimized: true },
|
||||
webpack: (config, { isServer }) => {
|
||||
config.resolve.fallback = { fs: false };
|
||||
if (!isServer) {
|
||||
config.plugins.push(
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: path.join(__dirname, 'node_modules/@oceanbase-odc/monaco-plugin-ob/worker-dist/'),
|
||||
to: 'static/ob-workers'
|
||||
},
|
||||
],
|
||||
})
|
||||
)
|
||||
// 添加 monaco-editor-webpack-plugin 插件
|
||||
config.plugins.push(
|
||||
new MonacoWebpackPlugin({
|
||||
// 你可以在这里配置插件的选项,例如:
|
||||
languages: ['sql'],
|
||||
filename: 'static/[name].worker.js'
|
||||
})
|
||||
);
|
||||
}
|
||||
return config;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
|
Reference in New Issue
Block a user