Port asset pipeline to Hanami

This commit is contained in:
2023-11-18 08:26:02 +11:00
parent d28e1d298b
commit cfbab5ab4b
21 changed files with 4747 additions and 573 deletions

View File

@@ -4,7 +4,7 @@ require "hanami"
module Adamantium
class App < Hanami::App
config.assets.manifest_path = "public/assets/asset-manifest.json"
config.assets.manifest_path = "public/assets.json"
config.actions.content_security_policy[:script_src] += " 'unsafe-eval' https://gist.github.com"
config.actions.content_security_policy[:script_src] += " *.dnitza.com"
@@ -23,16 +23,16 @@ module Adamantium
config.logger.stream = "log/hanami.log"
config.shared_app_component_keys += [
"param_parser.micropub_post",
"param_parser.webmention",
"post_utilities.slugify",
"post_utilities.link_finder",
"post_utilities.page_cacher",
"syndication.dayone",
"syndication.mastodon",
"syndication.blue_sky",
"syndication.raindrop",
"renderers.markdown",
"post_utilities.link_finder",
"param_parser.micropub_post",
"param_parser.webmention",
"post_utilities.page_cacher"
]
end
end

14
config/assets.js Normal file
View File

@@ -0,0 +1,14 @@
import * as assets from "hanami-assets";
await assets.run();
// To provide additional esbuild (https://esbuild.github.io) options, use the following:
//
// await assets.run({
// esbuildOptionsFn: (args, esbuildOptions) => {
// // Add to esbuildOptions here. Use `args.watch` as a condition for different options for
// // compile vs watch.
//
// return esbuildOptions;
// }
// });