@gracile/sitemap
Advanced tools
Comparing version 0.0.9 to 0.1.0-next.0
import { Readable } from 'node:stream'; | ||
import { logger } from '@gracile/internal-utils/logger'; | ||
import { logger } from '@gracile/internal-utils/logger/vite-logger'; | ||
import c from 'picocolors'; | ||
@@ -7,6 +7,14 @@ import { SitemapStream, streamToPromise } from 'sitemap'; | ||
export function viteSitemapPlugin(options) { | ||
let isSsrBuild = false; | ||
return { | ||
name: VITE_PLUGIN_NAME, | ||
enforce: 'post', | ||
config(_, env) { | ||
isSsrBuild = env.isSsrBuild || false; | ||
}, | ||
async generateBundle(_, bundle) { | ||
if (isSsrBuild) { | ||
logger.error(`\n${VITE_PLUGIN_NAME} is only compatible with static output!\n`); | ||
return; | ||
} | ||
const links = Object.entries(bundle) | ||
@@ -13,0 +21,0 @@ .filter(([, asset]) => asset.fileName.endsWith('.html')) |
{ | ||
"name": "@gracile/sitemap", | ||
"version": "0.0.9", | ||
"version": "0.1.0-next.0", | ||
"description": "A thin, full-stack, web framework", | ||
@@ -37,3 +37,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@gracile/internal-utils": "^0.2.1", | ||
"@gracile/internal-utils": "^0.3.0-next.0", | ||
"picocolors": "^1.0.0", | ||
@@ -49,3 +49,3 @@ "sitemap": "8.0.0" | ||
}, | ||
"gitHead": "6d4f25507897a91b31485317ccc8e77850b8fa40" | ||
"gitHead": "3f052f63a2ecd3baa7a8a10863e802ad5ac82a9d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42885
68
+ Added@gracile/internal-utils@0.3.1(transitive)
- Removed@gracile/internal-utils@0.2.1(transitive)