fix: pages dir in root
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@
|
||||
"",
|
||||
"<THIRD_PARTY_MODULES>",
|
||||
"",
|
||||
"^(@shared|@entities|@features|@widgets|@pagesLayer|@app)(/.*)$",
|
||||
"^(@shared|@entities|@features|@widgets|@pages|@app)(/.*)$",
|
||||
"",
|
||||
"^(?!.*[.]scss$)[./].*$",
|
||||
".scss$",
|
||||
|
||||
@@ -1,19 +1,31 @@
|
||||
# Next.js + Feature-Sliced Design | Pure Template
|
||||
|
||||
## IMPORTANT
|
||||
Do not delete the pages* folder even if you are using App Router, deleting the pages folder
|
||||
will result in a [build error](https://t.me/feature_sliced/1/107414).
|
||||
|
||||
## ADDITIONAL SOLUTION TO THE PROBLEM
|
||||
If you don't like the empty "pages" folder in the project root, you can rename the pages layer (./src/pages)
|
||||
for example to "pagesLayer" and then delete the pages folder from the project root.
|
||||
|
||||
**Use what you like best <3**
|
||||
|
||||
---
|
||||
|
||||
## Folders description
|
||||
|
||||
| Folder | Description |
|
||||
|-----------------|-----------------------------------------------------------------------------------------------------------------|
|
||||
|--------------|-----------------------------------------------------------------------------------------------------------------|
|
||||
| app | Next App folder for [App Routing](https://nextjs.org/docs/app/building-your-application/routing#the-app-router) |
|
||||
| pages * | Next Pages folder for [Pages Routing](https://nextjs.org/docs/pages) |
|
||||
| public | Public files |
|
||||
| src/app | App FSD Layer |
|
||||
| src/pagesLayer* | Pages FSD Layer |
|
||||
| src/pages | Pages FSD Layer |
|
||||
| src/widgets | Widgets FSD Layer |
|
||||
| src/features | Features FSD Layer |
|
||||
| src/entities | Entities FSD Layer |
|
||||
| src/shared | Shared FSD Layer |
|
||||
|
||||
* **pagesLayer**, not **pages** because _*pages*_ is a reserved name for [Pages Router](https://nextjs.org/docs/pages) and an error occurs during [assembly](https://t.me/feature_sliced/1/107414).
|
||||
## Remove junk _.gitkeep_ files
|
||||
|
||||
### UNIX
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { HomePage } from "@pagesLayer/HomePage"
|
||||
import { HomePage } from "@pages/HomePage"
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ const config: Config = {
|
||||
"@app/(.*)$": "<rootDir>/src/app/$1",
|
||||
"@entities/(.*)$": "<rootDir>/src/entities/$1",
|
||||
"@features/(.*)$": "<rootDir>/src/features/$1",
|
||||
"@pagesLayer/(.*)$": "<rootDir>/src/pagesLayer/$1",
|
||||
"@pages/(.*)$": "<rootDir>/src/pages/$1",
|
||||
"@shared/(.*)$": "<rootDir>/src/shared/$1",
|
||||
"@widgets/(.*)$": "<rootDir>/src/widgets/$1",
|
||||
"@/(.*)$": "<rootDir>/src/$1",
|
||||
|
||||
@@ -16,8 +16,8 @@ const HomePage = () => {
|
||||
</Link>
|
||||
</p>
|
||||
<pre className={cls.hint} data-testid="hint-code">
|
||||
You can edit <span className={cls.path}>src/pagesLayer/HomePage</span>{" "}
|
||||
to start {"<3"}!<br />
|
||||
You can edit <span className={cls.path}>src/pages/HomePage</span> to
|
||||
start {"<3"}!<br />
|
||||
<small className={cls.testHint}>
|
||||
You can also test your application using Jest :D. Try it!
|
||||
</small>
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
"@app/*": ["./src/app/*"],
|
||||
"@entities/*": ["./src/entities/*"],
|
||||
"@features/*": ["./src/features/*"],
|
||||
"@pagesLayer/*": ["./src/pagesLayer/*"],
|
||||
"@pages/*": ["./src/pages/*"],
|
||||
"@shared/*": ["./src/shared/*"],
|
||||
"@widgets/*": ["./src/widgets/*"],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user