fix(astro-integrations): check if distURL is null

This commit is contained in:
xHyroM 2023-06-02 23:44:45 +02:00
parent b09a520282
commit 49546bed12
No known key found for this signature in database
GPG key ID: BE0423F386C436AA

View file

@ -9,10 +9,9 @@ export default (): AstroIntegration => {
hooks: {
"astro:build:done": async (opts) => {
for (const route of opts.routes) {
const content = await readFile(
fileURLToPath(route.distURL!),
"utf-8"
);
if (!route.distURL) continue;
const content = await readFile(fileURLToPath(route.distURL), "utf-8");
const minified = await minify(content, {
removeAttributeQuotes: true,
collapseWhitespace: true,