1.1.1 • Published 1 year ago
next-page-pathmap v1.1.1
Pathmap Generator for 'Pages' directory of Next.js
Requirements
- node.js >= 14.0.0
Core dependencies
How to use
npx script running fashion.
npx demo-npm-cli-tool # cannot define config file.
or
npm install demo-npm-cli-tool
Configuration vs. Cli Interactions
To configure required properties you should define either configuration in pathmap.config.json
or via CLI-input
.
pathmap.config.json
{
"pathToPages": "src/pages",
"pathToSave": "path/path.json",
"includes": ["**/*.page.{ts,tsx}"],
"excludes": ["!node_modules"], // remember, path expression in excludes must start with exclamation mark.
"schema": {
"query": []
// any key:value pairs..
}
}
Interactive CLI Dialogs.
? Enter the path to the '/pages' directory. src/pages
? Enter the destination to save jsonized pathmap file. pathmap/pathmap.json
? includes: **/*.page.{ts,tsx}
? excludes: **/[!_]*.{ts,tsx}, **/[!A-Z]*.page.{ts,tsx}, !api
Result
{
"/": {
"alias": "",
"trackPageView": true,
"query": []
},
"/services/loan": {
"alias": "",
"trackPageView": true,
"query": []
}
}
© WONKOOK LEE
1.1.1
1 year ago