refactor: replace webpack context loading with dev server proxy
Remove the webpack-based file indexing strategy in favor of a proxy approach. The dev server now proxies content requests to a local CLI server, simplifying the data loading logic and removing webpack-specific types and loaders.
This commit is contained in:
+9
-13
@@ -18,15 +18,6 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
rspack: {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.md|\.yarn|\.csv$/,
|
||||
exclude: /\.schema\.csv$/,
|
||||
type: "asset/source",
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
process.env.ANALYZE ? new BundleAnalyzerPlugin() : undefined,
|
||||
].filter(Boolean),
|
||||
@@ -40,13 +31,18 @@ export default defineConfig({
|
||||
index: "./src/main.tsx",
|
||||
},
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
// Proxy content API requests to the CLI dev server (npm run tttk)
|
||||
"/__CONTENT_INDEX.json": "http://localhost:3000",
|
||||
"/__COMPLETIONS.json": "http://localhost:3000",
|
||||
"/content": "http://localhost:3000",
|
||||
"/journal": "http://localhost:3000",
|
||||
},
|
||||
},
|
||||
output: {
|
||||
distPath: {
|
||||
root: "dist/web",
|
||||
},
|
||||
copy:
|
||||
process.env.NODE_ENV === "development"
|
||||
? [{ from: "./content", to: "content" }]
|
||||
: [],
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user