-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[astro-purgecss] Disable renaming css files with new hashes in ssr mo…
…de (#746) * Fix files not found in SSR mode * Format files * Fix comments * docs(changeset): Disable renaming css files with new hashes in ssr mode
- Loading branch information
Showing
33 changed files
with
590 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro-purgecss': minor | ||
--- | ||
|
||
Disable renaming css files with new hashes in ssr mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Expose Astro dependencies for `pnpm` users | ||
shamefully-hoist=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# PurgeCSS Example app | ||
|
||
This is an example app to showcase the `astro-purgecss` integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import purgecss from '../../packages/astro-purgecss/src'; | ||
|
||
import node from '@astrojs/node'; | ||
|
||
export default defineConfig({ | ||
// Add purgecss support to Astro | ||
integrations: [ | ||
purgecss({ | ||
fontFace: true, | ||
keyframes: true, | ||
safelist: ['random', 'yep', 'button', /^nav-/], | ||
blocklist: ['usedClass', /^nav-/], | ||
content: [process.cwd() + '/src/**/*.astro'] | ||
}) | ||
], | ||
|
||
output: 'server', | ||
|
||
build: { | ||
format: 'preserve', | ||
inlineStylesheets: 'never' | ||
}, | ||
|
||
adapter: node({ | ||
mode: 'standalone' | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "@orbit/example-purgecss", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"dev": "astro dev", | ||
"start": "astro dev", | ||
"build": "astro build", | ||
"preview": "astro preview", | ||
"astro": "astro" | ||
}, | ||
"devDependencies": { | ||
"astro": "^4.0.0" | ||
}, | ||
"dependencies": { | ||
"@astrojs/node": "^8.3.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.light-theme { | ||
background-color: white; | ||
color: black; | ||
} | ||
|
||
.unused-class-external { | ||
color: red; /* unused */ | ||
} | ||
.unused-class-external-2 { | ||
color: blue; /* unused */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.light-theme { | ||
background-color: white; | ||
color: black; | ||
} | ||
|
||
.unused-class-external { | ||
color: red; /* unused */ | ||
} | ||
.unused-class-external-2 { | ||
color: blue; /* unused */ | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/// <reference path="../.astro/types.d.ts" /> | ||
/// <reference types="astro/client" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | ||
<link rel="stylesheet" href="/assets/css/theme.css" /> | ||
<link rel="stylesheet" href="/assets/css/plugin.css" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
<meta name="generator" content={Astro.generator} /> | ||
<title>Astro</title> | ||
</head> | ||
<body class="light-theme"> | ||
<slot /> | ||
</body> | ||
<style is:global> | ||
html { | ||
height: 100vh; | ||
} | ||
body { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
font-family: 'Courier New', Courier, monospace; | ||
color: white; | ||
margin: 0; | ||
padding: 0; | ||
height: 100%; | ||
background: #3023ae; | ||
background: linear-gradient(135deg, #3023ae 0%, #c86dd7 100%); | ||
} | ||
/* | ||
* DO_NOT_REMOVE: The following css rules, | ||
* they are left here on purpose, to test out | ||
* the "astro-purgecss" integration | ||
*/ | ||
.sm\:hidden { | ||
color: red; /* used */ | ||
} | ||
.unused-class { | ||
color: red; /* unused */ | ||
} | ||
.unused-class-2 { | ||
color: blue; /* unused */ | ||
} | ||
#unused-id { | ||
color: red; /* unused */ | ||
} | ||
#unused-id-2 { | ||
color: red; /* unused */ | ||
} | ||
footer { | ||
color: red; /* unused */ | ||
} | ||
</style> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
import Layout from '../../../../layouts/main.astro'; | ||
--- | ||
|
||
<Layout> | ||
<section class="main"> | ||
<h1>Astro PurgeCSS</h1> | ||
<p> | ||
This is a playground to check all the <code>astro-purgecss</code> integration | ||
</p> | ||
<p class="sm:hidden"> | ||
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero esse | ||
accusantium, dignissimos corporis ipsam, atque facere expedita aliquid | ||
repellat, unde alias voluptatem officia ullam. Perferendis ipsam facilis | ||
officiis beatae nam. | ||
</p> | ||
</section> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
import Layout from '../layouts/main.astro'; | ||
--- | ||
|
||
<Layout> | ||
<section class="main"> | ||
<h1>Astro PurgeCSS</h1> | ||
<p> | ||
This is a playground to check all the <code>astro-purgecss</code> integration | ||
</p> | ||
<p class="sm:hidden"> | ||
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero esse | ||
accusantium, dignissimos corporis ipsam, atque facere expedita aliquid | ||
repellat, unde alias voluptatem officia ullam. Perferendis ipsam facilis | ||
officiis beatae nam. | ||
</p> | ||
</section> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
import Layout from '../../layouts/main.astro'; | ||
--- | ||
|
||
<Layout> | ||
<section class="main"> | ||
<h1>Astro PurgeCSS</h1> | ||
<p> | ||
This is a playground to check all the <code>astro-purgecss</code> integration | ||
</p> | ||
<p class="sm:hidden"> | ||
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero esse | ||
accusantium, dignissimos corporis ipsam, atque facere expedita aliquid | ||
repellat, unde alias voluptatem officia ullam. Perferendis ipsam facilis | ||
officiis beatae nam. | ||
</p> | ||
</section> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
import Layout from '../layouts/main.astro'; | ||
--- | ||
|
||
<Layout> | ||
<section class="main"> | ||
<h1>Astro PurgeCSS</h1> | ||
<p> | ||
This is a playground to check all the <code>astro-purgecss</code> integration | ||
</p> | ||
<p class="sm:hidden"> | ||
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero esse | ||
accusantium, dignissimos corporis ipsam, atque facere expedita aliquid | ||
repellat, unde alias voluptatem officia ullam. Perferendis ipsam facilis | ||
officiis beatae nam. | ||
</p> | ||
</section> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "astro/tsconfigs/strict" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"extends": "astro/tsconfigs/strict" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.