mirror of
https://git.mirrors.martin98.com/https://github.com/bytedance/deer-flow
synced 2025-08-20 09:59:07 +08:00
chore: support both turbopack and webpack
This commit is contained in:
parent
f6af751e95
commit
e578c90bb6
@ -8,15 +8,16 @@
|
|||||||
import "./src/env.js";
|
import "./src/env.js";
|
||||||
|
|
||||||
/** @type {import("next").NextConfig} */
|
/** @type {import("next").NextConfig} */
|
||||||
|
|
||||||
|
// DeerFlow leverages **Turbopack** during development for faster builds and a smoother developer experience.
|
||||||
|
// However, in production, **Webpack** is used instead.
|
||||||
|
//
|
||||||
|
// This decision is based on the current recommendation to avoid using Turbopack for critical projects, as it
|
||||||
|
// is still evolving and may not yet be fully stable for production environments.
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
rewrites: async () => [
|
// For development mode
|
||||||
{
|
turbopack: {
|
||||||
source: "/api/podcast/:path*",
|
|
||||||
destination: "http://localhost:8000/api/podcast/:path*",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
experimental: {
|
|
||||||
turbo: {
|
|
||||||
rules: {
|
rules: {
|
||||||
"*.md": {
|
"*.md": {
|
||||||
loaders: ["raw-loader"],
|
loaders: ["raw-loader"],
|
||||||
@ -24,6 +25,14 @@ const config = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// For production mode
|
||||||
|
webpack: (config) => {
|
||||||
|
config.module.rules.push({
|
||||||
|
test: /\.md$/,
|
||||||
|
use: "raw-loader",
|
||||||
|
});
|
||||||
|
return config;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user