jbaubree / vite-plugin-sitemap Goto Github PK
View Code? Open in Web Editor NEWSitemap generator plugin for Vite
License: MIT License
Sitemap generator plugin for Vite
License: MIT License
It's common to have multiple Sitemap:
directives in a robots.txt file.
Especially for retail sites that may have a large number of products that are frequently updated. Product sitemaps can be generated in realtime.
So, you may have something like this:
Sitemap: https://example.com/sitemap.xml <----- handles basic static pages, can probably get generated at buildtime
Sitemap: https://example.com/products_sitemap.xml <---- handles products, will be generated in realtime or server side as needed
See https://www.walmart.com/robots.txt for a realworld example
Any idea or plans on how we can support view router to generate paths in our sitemap?
Hi there, I was attempting to try this out (on a project of mine) but after adding this to my dev dependencies the output I get is:
⊙ pnpm run build julian@Mini
> [email protected] build /Users/julian/Development/bowtie/frontend
> tsc && vite build
vite v5.0.12 building for production...
node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/react-bootstrap/esm/FormControl.js (1:0) Error when using sourcemap for reporting an error: Can't resolve original location of error.
node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/react-bootstrap/esm/DropdownMenu.js (1:0) Error when using sourcemap for reporting an error: Can't resolve original location of error.
node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/react-bootstrap/esm/FormLabel.js (1:0) Error when using sourcemap for reporting an error: Can't resolve original location of error.
node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/react-bootstrap/esm/ListGroup.js (1:0) Error when using sourcemap for reporting an error: Can't resolve original location of error.
node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/react-bootstrap/esm/ListGroupItem.js (1:0) Error when using sourcemap for reporting an error: Can't resolve original location of error.
node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/react-bootstrap/esm/OverlayTrigger.js (1:0) Error when using sourcemap for reporting an error: Can't resolve original location of error.
✓ 2331 modules transformed.
build/index.html 0.52 kB │ gzip: 0.32 kB
build/assets/index-F4sdiRem.css 233.12 kB │ gzip: 31.46 kB
build/assets/index-xqEkhzsp.js 491.12 kB │ gzip: 156.60 kB │ map: 1,797.82 kB
✓ built in 2.38s
error during build:
Error: ENOENT: no such file or directory, open '/Users/julian/Development/bowtie/frontend/dist/robots.txt'
at Object.writeFileSync (node:fs:2343:20)
at generateSitemap (/Users/julian/Development/bowtie/frontend/node_modules/.pnpm/[email protected]/node_modules/vite-plugin-sitemap/dist/index.js:10964:13)
at Object.closeBundle (/Users/julian/Development/bowtie/frontend/node_modules/.pnpm/[email protected]/node_modules/vite-plugin-sitemap/dist/index.js:10984:7)
at file:///Users/julian/Development/bowtie/frontend/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:18692:40
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 0)
at async PluginDriver.hookParallel (file:///Users/julian/Development/bowtie/frontend/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:18620:9)
at async Object.close (file:///Users/julian/Development/bowtie/frontend/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19544:13)
at async build (file:///Users/julian/Development/bowtie/frontend/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:67191:13)
at async CAC.<anonymous> (file:///Users/julian/Development/bowtie/frontend/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/cli.js:845:9)
ELIFECYCLE Command failed with exit code 1.
I assume this has to do with us setting outDir
to something, and perhaps that being hardcoded here to look in dist/
but I haven't looked carefully at diagnosing so apologies if that's way off. I may try to do so later, but filing just in case it's helpful as-is.
OS: Windows 10 Home Single Language
OS Build: 19043.2006
Node: v16.13.2
Pnpm: v7.6.0
failed to load config from D:\Project\_Reproduction\reproduction-web-brand-issue\vite.config.js
error when starting dev server:
TypeError: Sitemap is not a function
at file:///D:/Project/_Reproduction/reproduction-web-brand-issue/vite.config.js.timestamp-1663841008339.mjs:28:5
at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
at async loadConfigFromBundledFile (file:///D:/Project/_Reproduction/reproduction-web-brand-issue/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-557f29e6.js:63494:21)
at async loadConfigFromFile (file:///D:/Project/_Reproduction/reproduction-web-brand-issue/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-557f29e6.js:63380:28)
at async resolveConfig (file:///D:/Project/_Reproduction/reproduction-web-brand-issue/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-557f29e6.js:62997:28)
at async createServer (file:///D:/Project/_Reproduction/reproduction-web-brand-issue/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-557f29e6.js:62063:20)
at async CAC.<anonymous> (file:///D:/Project/_Reproduction/reproduction-web-brand-issue/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/cli.js:700:24)
ELIFECYCLE Command failed with exit code 1.
OS: Manjaro Linux x64
Node : v18.7.0
PNPM : 7.10.0
Example working, because plugin installed directly from workspace, but when I'm installed this plugin via pnpm it won't run
failed to load config from /home/akira/NODE_PROJECT/heramom-vite/vite.config.ts
error when starting dev server:
TypeError: Sitemap is not a function
at file:///home/akira/NODE_PROJECT/heramom-vite/vite.config.ts.timestamp-1662360498371.mjs:64:5
at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:541:24)
at async loadConfigFromBundledFile (file:///home/akira/NODE_PROJECT/heramom-vite/node_modules/.pnpm/[email protected]_bckpmeqyxpddtxgilj5fird5uy/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:63077:21)
at async loadConfigFromFile (file:///home/akira/NODE_PROJECT/heramom-vite/node_modules/.pnpm/[email protected]_bckpmeqyxpddtxgilj5fird5uy/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:62963:28)
at async resolveConfig (file:///home/akira/NODE_PROJECT/heramom-vite/node_modules/.pnpm/[email protected]_bckpmeqyxpddtxgilj5fird5uy/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:62577:28)
at async createServer (file:///home/akira/NODE_PROJECT/heramom-vite/node_modules/.pnpm/[email protected]_bckpmeqyxpddtxgilj5fird5uy/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:59183:20)
at async CAC.<anonymous> (file:///home/akira/NODE_PROJECT/heramom-vite/node_modules/.pnpm/[email protected]_bckpmeqyxpddtxgilj5fird5uy/node_modules/vite/dist/node/cli.js:699:24)
ELIFECYCLE Command failed with exit code 1.
```
i just want run only generation sitemap with one command line. instead of build whole project with command "npm run build". Can you help me!!!
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@vue/compiler-sfc
, vue
).github/workflows/ci.yml
actions/checkout v3
pnpm/action-setup v2
actions/setup-node v3
example/package.json
react 18.2.0
vue 3.2.47
vue-router 4.2.5
@vitejs/plugin-vue 4.4.0
@vue/compiler-sfc 3.3.6
cross-env 7.0.3
nodemon 3.0.1
typescript 5.2.2
vite 4.5.0
vite-plugin-pages 0.31.0
package.json
@antfu/eslint-config 0.43.1
@types/node 18.18.6
eslint 8.51.0
pkgroll 2.0.1
pnpm 8.9.2
sitemap-ts 1.6.1
typescript 5.2.2
vite 4.5.0
vite-plugin-pages 0.31.0
vue-tsc 1.8.19
pnpm 8.9.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.