mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00

* feat: dataset controllers feat: dataset schema fix: add missing type to dataset schema Signed-off-by: FinleyGe <m13203533462@163.com> * feat: dataset list api Signed-off-by: FinleyGe <m13203533462@163.com> * chore: all dataset api Signed-off-by: FinleyGe <m13203533462@163.com> * feat: new auth dataset method Signed-off-by: FinleyGe <m13203533462@163.com> * chore: use new auth method in detail, paths. feat: add new param defaultPermission to create api Signed-off-by: FinleyGe <m13203533462@163.com> * chore: app auth params Signed-off-by: FinleyGe <m13203533462@163.com> * chore: use new auth method Signed-off-by: FinleyGe <m13203533462@163.com> * feat: new auth collection and file method Signed-off-by: FinleyGe <m13203533462@163.com> * chore: dataset collection api new auth Signed-off-by: FinleyGe <m13203533462@163.com> * chore: create/*.ts auth Signed-off-by: FinleyGe <m13203533462@163.com> * chore: dataset auth Signed-off-by: FinleyGe <m13203533462@163.com> * fix: import paths Signed-off-by: FinleyGe <m13203533462@163.com> * feat: dataset collaborator Signed-off-by: FinleyGe <m13203533462@163.com> * chore: dataset frontend feat: dataset list frontend feat: dataset detail Signed-off-by: FinleyGe <m13203533462@163.com> * feat: finish the dataset permission fix: ts errors Signed-off-by: FinleyGe <m13203533462@163.com> * fix: empty response of collection api Signed-off-by: FinleyGe <m13203533462@163.com> * chore: adjust the code * chore: adjust the code * chore: i18n * fix: ts error * fix: fe CollectionCard permission --------- Signed-off-by: FinleyGe <m13203533462@163.com>
103 lines
2.6 KiB
JavaScript
103 lines
2.6 KiB
JavaScript
const { i18n } = require('./next-i18next.config');
|
|
const path = require('path');
|
|
|
|
const isDev = process.env.NODE_ENV === 'development';
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
i18n,
|
|
output: 'standalone',
|
|
reactStrictMode: isDev ? false : true,
|
|
compress: true,
|
|
webpack(config, { isServer, nextRuntime }) {
|
|
Object.assign(config.resolve.alias, {
|
|
'@mongodb-js/zstd': false,
|
|
'@aws-sdk/credential-providers': false,
|
|
snappy: false,
|
|
aws4: false,
|
|
'mongodb-client-encryption': false,
|
|
kerberos: false,
|
|
'supports-color': false,
|
|
'bson-ext': false,
|
|
'pg-native': false
|
|
});
|
|
config.module = {
|
|
...config.module,
|
|
rules: config.module.rules.concat([
|
|
{
|
|
test: /\.svg$/i,
|
|
issuer: /\.[jt]sx?$/,
|
|
use: ['@svgr/webpack']
|
|
},
|
|
{
|
|
test: /\.node$/,
|
|
use: [{ loader: 'nextjs-node-loader' }]
|
|
}
|
|
]),
|
|
exprContextCritical: false,
|
|
unknownContextCritical: false
|
|
};
|
|
|
|
if (!config.externals) {
|
|
config.externals = [];
|
|
}
|
|
|
|
if (isServer) {
|
|
// config.externals.push('@zilliz/milvus2-sdk-node');
|
|
|
|
if (nextRuntime === 'nodejs') {
|
|
const oldEntry = config.entry;
|
|
config = {
|
|
...config,
|
|
async entry(...args) {
|
|
const entries = await oldEntry(...args);
|
|
return {
|
|
...entries,
|
|
'worker/htmlStr2Md': path.resolve(
|
|
process.cwd(),
|
|
'../../packages/service/worker/htmlStr2Md/index.ts'
|
|
),
|
|
'worker/countGptMessagesTokens': path.resolve(
|
|
process.cwd(),
|
|
'../../packages/service/worker/tiktoken/countGptMessagesTokens.ts'
|
|
),
|
|
'worker/readFile': path.resolve(
|
|
process.cwd(),
|
|
'../../packages/service/worker/file/read.ts'
|
|
)
|
|
};
|
|
}
|
|
};
|
|
}
|
|
} else {
|
|
config.resolve = {
|
|
...config.resolve,
|
|
fallback: {
|
|
...config.resolve.fallback,
|
|
fs: false
|
|
}
|
|
};
|
|
}
|
|
|
|
config.experiments = {
|
|
asyncWebAssembly: true,
|
|
layers: true
|
|
};
|
|
|
|
return config;
|
|
},
|
|
transpilePackages: ['@fastgpt/*', 'ahooks'],
|
|
experimental: {
|
|
// 优化 Server Components 的构建和运行,避免不必要的客户端打包。
|
|
serverComponentsExternalPackages: [
|
|
'mongoose',
|
|
'pg',
|
|
'@node-rs/jieba',
|
|
'@zilliz/milvus2-sdk-node'
|
|
],
|
|
outputFileTracingRoot: path.join(__dirname, '../../')
|
|
}
|
|
};
|
|
|
|
module.exports = nextConfig;
|