From e2096097396e9ded14730a58a9adfd684afa515a Mon Sep 17 00:00:00 2001 From: rydmike Date: Sat, 16 Nov 2024 17:58:09 +0200 Subject: [PATCH] TRY: WASM build and deploy to Netlify with TOML file present Also update site url used for link to config. --- .../workflows/deploy_playground_netlify.yml | 2 +- example/lib/shared/const/app.dart | 3 +- netlify.toml | 38 +++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 netlify.toml diff --git a/.github/workflows/deploy_playground_netlify.yml b/.github/workflows/deploy_playground_netlify.yml index 79eadd40..0b56f133 100644 --- a/.github/workflows/deploy_playground_netlify.yml +++ b/.github/workflows/deploy_playground_netlify.yml @@ -2,7 +2,7 @@ # # This workflow: # - Installs dart and flutter -# - Uses latest flutter stable channel. +# - Uses the latest flutter stable channel. # Consider setting up a matrix later with beta and dev included too. # - Enables flutter web # - Gets package dependencies diff --git a/example/lib/shared/const/app.dart b/example/lib/shared/const/app.dart index 713bc921..571fc9b3 100644 --- a/example/lib/shared/const/app.dart +++ b/example/lib/shared/const/app.dart @@ -57,8 +57,7 @@ sealed class App { static const String author = 'Mike Rydstrom'; static const String license = 'BSD 3-Clause License'; static const String icon = 'assets/images/app_icon.png'; - static const String playgroundURL = - 'https://rydmike.com/flexcolorscheme/themesplayground-dev/'; + static const String playgroundURL = 'https://playground.flexcolorscheme.com/'; static final Uri packageUri = Uri( scheme: 'https', host: 'pub.dev', diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 00000000..18ed762d --- /dev/null +++ b/netlify.toml @@ -0,0 +1,38 @@ +[[ +headers +]] +for = "/*" +[ +headers.values +] +Cross-Origin-Embedder-Policy = "require-corp" +Cross-Origin-Opener-Policy = "same-origin" + +[[ +headers +]] +for = "/*.wasm" +[ +headers.values +] +Content-Type = "application/wasm" + +[[ +headers +]] +for = "/main.dart.js" +[ +headers.values +] +Cross-Origin-Embedder-Policy = "require-corp" +Cross-Origin-Opener-Policy = "same-origin" + +[[ +headers +]] +for = "/flutter.js" +[ +headers.values +] +Cross-Origin-Embedder-Policy = "require-corp" +Cross-Origin-Opener-Policy = "same-origin" \ No newline at end of file