Skip to content

Commit

Permalink
refactor: mv presets azion.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jotanarciso committed Nov 6, 2024
1 parent 4c023bd commit cae934f
Show file tree
Hide file tree
Showing 19 changed files with 175 additions and 850 deletions.
56 changes: 7 additions & 49 deletions lib/presets/angular/azion.config.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,10 @@
import { defineConfig } from 'azion';
/**
* NOTE: We are gradually migrating all configurations to the Azion library
* through the azion/presets package (@https://github.com/aziontech/lib/tree/main/packages/presets).
* This helps standardize our setup and maintain consistency across projects.
*/

const config = defineConfig({
build: {
preset: {
name: 'angular',
},
},
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`,
},
},
],
},
});
import { Angular } from 'azion/presets';

const { config } = Angular;
export default config;
62 changes: 8 additions & 54 deletions lib/presets/astro/azion.config.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,11 @@
import { defineConfig } from 'azion';
/**
* NOTE: We are gradually migrating all configurations to the Azion library
* through the azion/presets package (@https://github.com/aziontech/lib/tree/main/packages/presets).
* This helps standardize our setup and maintain consistency across projects.
*/

const config = defineConfig({
build: {
preset: {
name: 'astro',
},
},
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: '${uri}index.html',
},
},
{
name: 'Redirect to index.html for Subpaths',
match: '^(?!.*\\/$)(?![\\s\\S]*\\.[a-zA-Z0-9]+$).*',
behavior: {
rewrite: '${uri}/index.html',
},
},
],
},
});
import { Astro } from 'azion/presets';

const { config } = Astro;

export default config;
62 changes: 8 additions & 54 deletions lib/presets/docusaurus/azion.config.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,11 @@
import { defineConfig } from 'azion';
/**
* NOTE: We are gradually migrating all configurations to the Azion library
* through the azion/presets package (@https://github.com/aziontech/lib/tree/main/packages/presets).
* This helps standardize our setup and maintain consistency across projects.
*/

const config = defineConfig({
build: {
preset: {
name: 'docusaurus',
},
},
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: '${uri}index.html',
},
},
{
name: 'Redirect to index.html for Subpaths',
match: '^(?!.*\\/$)(?![\\s\\S]*\\.[a-zA-Z0-9]+$).*',
behavior: {
rewrite: '${uri}/index.html',
},
},
],
},
});
import { Docusaurus } from 'azion/presets';

const { config } = Docusaurus;

export default config;
62 changes: 8 additions & 54 deletions lib/presets/eleventy/azion.config.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,11 @@
import { defineConfig } from 'azion';
/**
* NOTE: We are gradually migrating all configurations to the Azion library
* through the azion/presets package (@https://github.com/aziontech/lib/tree/main/packages/presets).
* This helps standardize our setup and maintain consistency across projects.
*/

const config = defineConfig({
build: {
preset: {
name: 'eleventy',
},
},
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: '${uri}index.html',
},
},
{
name: 'Redirect to index.html for Subpaths',
match: '^(?!.*\\/$)(?![\\s\\S]*\\.[a-zA-Z0-9]+$).*',
behavior: {
rewrite: '${uri}/index.html',
},
},
],
},
});
import { Eleventy } from 'azion/presets';

const { config } = Eleventy;

export default config;
29 changes: 8 additions & 21 deletions lib/presets/emscripten/azion.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
import { defineConfig } from 'azion';
/**
* NOTE: We are gradually migrating all configurations to the Azion library
* through the azion/presets package (@https://github.com/aziontech/lib/tree/main/packages/presets).
* This helps standardize our setup and maintain consistency across projects.
*/

const config = defineConfig({
build: {
preset: {
name: 'emscripten',
},
},
rules: {
request: [
{
name: 'Execute Edge Function',
match: '^\\/',
behavior: {
runFunction: {
path: '.edge/worker.js',
},
},
},
],
},
});
import { Emscripten } from 'azion/presets';

const { config } = Emscripten;

export default config;
64 changes: 10 additions & 54 deletions lib/presets/gatsby/azion.config.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,11 @@
import { defineConfig } from 'azion';
/**
* NOTE: We are gradually migrating all configurations to the Azion library
* through the azion/presets package (@https://github.com/aziontech/lib/tree/main/packages/presets).
* This helps standardize our setup and maintain consistency across projects.
*/

export default defineConfig({
build: {
preset: {
name: 'gatsby',
},
},
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: '${uri}index.html',
},
},
{
name: 'Redirect to index.html for Subpaths',
match: '^(?!.*\\/$)(?![\\s\\S]*\\.[a-zA-Z0-9]+$).*',
behavior: {
rewrite: '${uri}/index.html',
},
},
],
},
});
import { Gatsby } from 'azion/presets';

const { config } = Gatsby;

export default config;
Loading

0 comments on commit cae934f

Please sign in to comment.