docs(config): explain SDK example and compiler configuration
This commit is contained in:
@@ -8,6 +8,7 @@ const config: NextConfig = {
|
||||
reactStrictMode: true, poweredByHeader: false,
|
||||
/** 在现有规则后追加匹配ReactFlow ESM入口的loader,再返回原配置对象,保留框架其它规则。 */
|
||||
webpack(config) {
|
||||
// 规则只按路径匹配,不按客户端/服务端分支;loader 自身再检查安装版本和四段源码锚点。
|
||||
config.module.rules.push({
|
||||
test: /[\\/]@xyflow[\\/]react[\\/]dist[\\/]esm[\\/]index\.(?:mjs|js)$/,
|
||||
use: [{ loader: require.resolve("./scripts/loaders/xyflow-retained.cjs") }],
|
||||
@@ -25,6 +26,7 @@ const config: NextConfig = {
|
||||
},
|
||||
/** 只给版本目录内带12位十六进制摘要的JSON分片配置一年immutable缓存,文件内容变化应生成新文件名。
|
||||
* 不对图标目录manifest、页面或全部JSON一概设置immutable。 */
|
||||
// 这里只匹配 URL 外观,不重新读取文件验证摘要;重生成文件名和旧资源保留由资源脚本/发布流程负责。
|
||||
async headers() {
|
||||
return [{
|
||||
source: "/canvas-icons/:version/:asset([a-z0-9-]+-[a-f0-9]{12}\\.json)",
|
||||
|
||||
Reference in New Issue
Block a user