Skip to content

Commit

Permalink
feat: revert back to the .js config
Browse files Browse the repository at this point in the history
  • Loading branch information
ronanru committed Oct 22, 2024
1 parent 1a8a5a7 commit 955db26
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions cli/src/helpers/createProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export const createProject = async ({
if (appRouter) {
// Replace next.config
fs.copyFileSync(
path.join(PKG_ROOT, "template/extras/config/next-config-appdir.ts"),
path.join(projectDir, "next.config.ts")
path.join(PKG_ROOT, "template/extras/config/next-config-appdir.js"),
path.join(projectDir, "next.config.js")
);

selectLayoutFile({ projectDir, packages });
Expand Down
4 changes: 2 additions & 2 deletions cli/src/installers/envVars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const envVariablesInstaller: Installer = ({
"template/extras/src/env",
envFile
);
const envSchemaDest = path.join(projectDir, "src/env.ts");
const envSchemaDest = path.join(projectDir, "src/env.js");
fs.copyFileSync(envSchemaSrc, envSchemaDest);
}

Expand All @@ -63,7 +63,7 @@ const getEnvContent = (
scopedAppName: string
) => {
let content = `
# When adding additional environment variables, the schema in "/src/env.ts"
# When adding additional environment variables, the schema in "/src/env.js"
# should be updated accordingly.
`
.trim()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import { type NextConfig } from "next";

/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
import "./src/env";
await import("./src/env.js");

/** @type {import("next").NextConfig} */
const config = {
reactStrictMode: true,

/**
* If you are using `appDir` then you must comment the below `i18n` config out.
*
* @see https://github.com/vercel/next.js/issues/41980
*/
i18n: {
locales: ["en"],
defaultLocale: "en",
},
transpilePackages: ["geist"],
} satisfies NextConfig;
};

export default config;
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { type NextConfig } from "next";

/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
import "./src/env";
await import("./src/env.js");

const config = {} satisfies NextConfig;
/** @type {import("next").NextConfig} */
const config = {};

export default config;

0 comments on commit 955db26

Please sign in to comment.