summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/fast-build/astro.config.mjs11
-rw-r--r--examples/fast-build/package.json16
-rw-r--r--examples/fast-build/src/components/Greeting.vue20
-rw-r--r--examples/fast-build/src/images/penguin.jpgbin0 -> 12013 bytes
-rw-r--r--examples/fast-build/src/images/random.jpgbin0 -> 14553 bytes
-rw-r--r--examples/fast-build/src/pages/index.astro32
-rw-r--r--examples/fast-build/src/styles/global.css3
7 files changed, 82 insertions, 0 deletions
diff --git a/examples/fast-build/astro.config.mjs b/examples/fast-build/astro.config.mjs
new file mode 100644
index 000000000..32eca8696
--- /dev/null
+++ b/examples/fast-build/astro.config.mjs
@@ -0,0 +1,11 @@
+import { imagetools } from 'vite-imagetools';
+
+// @ts-check
+export default /** @type {import('astro').AstroUserConfig} */ ({
+ renderers: [
+ "@astrojs/renderer-vue"
+ ],
+ vite: {
+ plugins: [imagetools()]
+ }
+});
diff --git a/examples/fast-build/package.json b/examples/fast-build/package.json
new file mode 100644
index 000000000..4abd5fc13
--- /dev/null
+++ b/examples/fast-build/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "@example/fast-build",
+ "version": "0.0.1",
+ "private": true,
+ "scripts": {
+ "dev": "astro dev --experimental-static-build",
+ "start": "astro dev",
+ "build": "astro build --experimental-static-build",
+ "preview": "astro preview"
+ },
+ "devDependencies": {
+ "astro": "^0.21.6",
+ "unocss": "^0.15.5",
+ "vite-imagetools": "^4.0.1"
+ }
+}
diff --git a/examples/fast-build/src/components/Greeting.vue b/examples/fast-build/src/components/Greeting.vue
new file mode 100644
index 000000000..69fa4fbca
--- /dev/null
+++ b/examples/fast-build/src/components/Greeting.vue
@@ -0,0 +1,20 @@
+<script>
+export default {
+ data() {
+ return {
+ greeting: 'Hello World!',
+ };
+ },
+};
+</script>
+
+<template>
+ <p class="greeting">{{ greeting }}</p>
+</template>
+
+<style>
+.greeting {
+ color: red;
+ font-weight: bold;
+}
+</style>
diff --git a/examples/fast-build/src/images/penguin.jpg b/examples/fast-build/src/images/penguin.jpg
new file mode 100644
index 000000000..6c5dcd37a
--- /dev/null
+++ b/examples/fast-build/src/images/penguin.jpg
Binary files differ
diff --git a/examples/fast-build/src/images/random.jpg b/examples/fast-build/src/images/random.jpg
new file mode 100644
index 000000000..291883837
--- /dev/null
+++ b/examples/fast-build/src/images/random.jpg
Binary files differ
diff --git a/examples/fast-build/src/pages/index.astro b/examples/fast-build/src/pages/index.astro
new file mode 100644
index 000000000..b5b9785da
--- /dev/null
+++ b/examples/fast-build/src/pages/index.astro
@@ -0,0 +1,32 @@
+---
+import imgUrl from '../images/penguin.jpg';
+import grayscaleUrl from '../images/random.jpg?grayscale=true';
+import Greeting from '../components/Greeting.vue';
+---
+
+<html>
+<head>
+ <title>Demo app</title>
+ <style>
+ h1 { color: salmon; }
+ </style>
+</head>
+<body>
+ <section>
+ <h1>Images</h1>
+
+ <h2>Imported in JS</h2>
+ <img src={imgUrl} />
+ </section>
+
+ <section>
+ <h1>Component CSS</h1>
+ <Greeting />
+ </section>
+
+ <section>
+ <h1>ImageTools</h1>
+ <img src={grayscaleUrl} />
+ </section>
+</body>
+</html> \ No newline at end of file
diff --git a/examples/fast-build/src/styles/global.css b/examples/fast-build/src/styles/global.css
new file mode 100644
index 000000000..9f52e094e
--- /dev/null
+++ b/examples/fast-build/src/styles/global.css
@@ -0,0 +1,3 @@
+body {
+ background: lightcoral;
+}