Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework compression for faster build #615

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineConfig, passthroughImageService } from "astro/config";
import preact from "@astrojs/preact";
import mdx from "@astrojs/mdx";
import compress from "astro-compress";
import tailwind from "@astrojs/tailwind";
import serviceWorker from "astrojs-service-worker";
import fast from "./src/scripts/fast-compress";

// Allow skipping compression step for faster test build times
// DO NOT SKIP COMPRESSION FOR DEPLOYMENT!
Expand All @@ -18,13 +18,14 @@ if (shouldSkipCompress) {
// https://astro.build/config
export default defineConfig({
site: 'https://p5js.org',
compressHTML: false,
integrations: [
preact({
compat: true,
}),
mdx(),
tailwind(),
shouldSkipCompress ? null : compress(),
fast(),
serviceWorker({
workbox: {
globPatterns: [
Expand Down Expand Up @@ -54,6 +55,7 @@ export default defineConfig({
trailingSlash: "always",
build: {
format: "directory",
concurrency: 2
},
server: {
watch: {
Expand Down
Loading
Loading