Skip to content

Commit

Permalink
feat: new preset for preact ssg
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodiehl committed Feb 10, 2025
1 parent d33ad55 commit fa9acf2
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/presets/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import JavaScript from './presets/javascript/index';
import Jekyll from './presets/jekyll/index';
import Next from './presets/next/index';
import Nuxt from './presets/nuxt/index';
import Preact from './presets/preact/index';
import Qwik from './presets/qwik/index';
import React from './presets/react/index';
import RustWasm from './presets/rustwasm/index';
Expand All @@ -33,6 +34,7 @@ const presets = {
Jekyll,
Next,
Nuxt,
Preact,
Qwik,
React,
RustWasm,
Expand All @@ -56,6 +58,7 @@ export {
Jekyll,
Next,
Nuxt,
Preact,
Qwik,
React,
RustWasm,
Expand Down
46 changes: 46 additions & 0 deletions packages/presets/src/presets/preact/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { defineConfig } from 'azion/config';
export default defineConfig({
build: {
preset: {
name: 'react',
},
},
origin: [
{
name: 'origin-storage-default',
type: 'object_storage',
},
],
rules: {
request: [
{
name: 'Set Storage Origin for All Requests',
match: '^\\/',
behavior: {
setOrigin: {
name: 'origin-storage-default',
type: 'object_storage',
},
},
},
{
name: 'Deliver Static Assets',
match: '.(css|js|ttf|woff|woff2|pdf|svg|jpg|jpeg|gif|bmp|png|ico|mp4|json|xml|html)$',
behavior: {
setOrigin: {
name: 'origin-storage-default',
type: 'object_storage',
},
deliver: true,
},
},
{
name: 'Redirect to index.html',
match: '^\\/',
behavior: {
rewrite: `/index.html`,
},
},
],
},
});
4 changes: 4 additions & 0 deletions packages/presets/src/presets/preact/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { AzionBuildPreset } from '../../types';
import config from './config';
const preset: AzionBuildPreset = { config };
export default preset;

0 comments on commit fa9acf2

Please sign in to comment.