
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
A simple nuxt module to manage multiple subdomains with just a single nuxtJS project
Ever wondered how will you setup 3 sites of your own where you have same layouts & few shared components like feedback forms and so??
The simple way to do is copy, paste the same in all those 3 projects... isn't it??
But when you have to make changes, so you will require to copy the same thing in all the other projects...
This is not the right way... ❌❌❌
k-domains let's you manage any number of subdomains with ease and that too without even need to create separate project for each subdomain (site). All your layouts, shared components and the code for these sites will live in one project only.
All you have to is to just add k-domains and configure it in your nuxt.config.js file as shown in the #setup.
yarn add k-domains # or npm i k-domains
k-domains to your projectyarn add k-domains # or npm i k-domains
@nuxtjs/router to your projectyarn add @nuxtjs/router
k-domains and @nuxtjs/router to the buildModules section of nuxt.config.js as follows: export default {
buildModules: [
[ "k-domains", {
subDomains: [ ], // List of directories to hold te pages for your subdomains
rootDomain: "root-domain" // directory to hold the pages for root domain
}
],
["@nuxtjs/router",{
keepDefaultRouter: true // this line is mandatory...
}
]
]
}
export default {
buildModules: [
[ "k-domains", {
subDomains: ["blog", "projects", "anotherSubDomain" ], // List of directories to hold te pages for your subdomains
rootDomain: "main-domain" // directory to hold the pages for root domain
}
],
["@nuxtjs/router",{
keepDefaultRouter: true // this line is mandatory...
}
]
]
}
and the tree for the pages should look like this:
|
|─pages
| ├───blog
| ├───projects
| ├───main-domain
| └───anotherSubDomain
subDomainsArray<String>
Add your subdomains hererootDomainString
directory name for the pages of root-domain👤 krypton < madhusudanbabar@gmail.com >
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Consider giving a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator
FAQs
A simple module to manage multiple subdomains with just one project
The npm package k-domains receives a total of 31 weekly downloads. As such, k-domains popularity was classified as not popular.
We found that k-domains demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.