更改 "next export" 的文件夹
Change folder of "next export"
我有关注next.config.js
module.exports = {
dir: "src",
outDir: "./build"
};
当我 运行 next build; next export;
我的静态文件最终出现在新创建的 out
文件夹中。
我以为 outDir
会覆盖它,但显然不是。那么有没有办法告诉 next 将静态文件输出到 build
文件夹而不是 out
来自docs:
Absolute path to the out/ directory (configurable with -o or --outdir
你可以运行:
next export -o build/
将构建重定向到 build
目录。
我有关注next.config.js
module.exports = {
dir: "src",
outDir: "./build"
};
当我 运行 next build; next export;
我的静态文件最终出现在新创建的 out
文件夹中。
我以为 outDir
会覆盖它,但显然不是。那么有没有办法告诉 next 将静态文件输出到 build
文件夹而不是 out
来自docs:
Absolute path to the out/ directory (configurable with -o or --outdir
你可以运行:
next export -o build/
将构建重定向到 build
目录。