Replies: 2 comments 1 reply
-
Hello! The second alternatives looks fine to me! |
Beta Was this translation helpful? Give feedback.
1 reply
-
For anyone else hitting this page, @thibautsabot was very helpful, but didn't work for me (using TypeScript). What did work (in the TypeScript config file import type { NextConfig } from "next";
import type { webpack } from "next/dist/compiled/webpack/webpack"
type Configuration = webpack.Configuration;
const nextConfig: NextConfig = {
pageExtensions: process.env.NODE_ENV === "development"
? ["dev.tsx", "dev.ts", "tsx", "ts"]
: ["tsx", "ts"],
webpack(config: Configuration) {
// webpack config modifications, if any (I had some svg file handling in here)
return config;
},
};
export default nextConfig; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature you'd like to request
I have many development test pages collected along with normal pages under
/pages
.When I want to have a production build, I move/delete those development test pages in order not to be included in the production build.
What I request is an option to list pages files/folders to exclude from production build.
Describe the solution you'd like
Example for anticipated options within
next.config.js
:Describe alternatives you've considered
Alternative 1: Ignoring files/folders via
.gitignore
file on the git repo, however, I still need to include my test pages within my repository without them being included within the production build.Alternative 2: defining
pageExtensions
option to include dev pages while in development mode, and remove them while in production mode (this is manual work that's needed to be done on each production build):Beta Was this translation helpful? Give feedback.
All reactions