# WASM-Enabled Page Configuration Template # Copy this file to pages//config.toml and customize [page] name = "{{PAGE_NAME}}" title = "{{PAGE_TITLE}}" type = "wasm" # WASM-enabled page type description = "{{PAGE_DESCRIPTION}}" [directories] # Page-specific directories (relative to page root) src_dir = "src" dist_dir = "dist" css_src = "src/assets/css" css_dist = "dist/assets/css" svg_src = "src/assets/svg" svg_dist = "dist/assets/svg" js_src = "src/assets/js" js_dist = "dist/assets/js" [shared] # Shared assets to include (from shared/ directory) css_modules = [ "@shared/base/reset.css", "@shared/base/typography.css", "@shared/utilities/colors.css", "@shared/components/animated-text.css" ] svg_sprites = [ "@shared/common/symbols.svg" ] [local] # Page-specific CSS modules (from page css_src) css_modules = [ "main.css", "wasm-ui.css" # WASM-specific UI styles ] # Page-specific JavaScript modules (from page js_src) js_modules = [ "wasm-interface.js", # WASM integration code "main.js" ] # CSS optimization critical_modules = 2 minify = true remove_comments = true # JavaScript optimization minify_js = true remove_js_comments = true [output] # Output file names css_output = "main.min.css" html_output = "index.html" svg_sprites = "sprites.svg" js_output = "main.min.js" [svg] # SVG optimization optimize = true precision = 2 [html] # HTML optimization minify = true remove_comments = true remove_whitespace = true [development] # Development server settings port = 8080 host = "localhost" [thresholds] # File size thresholds (bytes) inline_css_max_size = 10240 # 10KB inline_svg_max_size = 5120 # 5KB max_total_size = 512000 # 500KB (larger for WASM) [compression] # Compression settings enable_gzip = true gzip_ratio = 0.3 [build] # Build optimization parallel_builds = true cache_bust = true verbose = true [tools] # External minification tools js_minifier = "swc" js_minifier_path = "" js_minifier_args = ["--minify", "--target", "es2018"] css_minifier = "" html_minifier = "" [wasm] # WebAssembly compilation settings enabled = true source_dir = "src/wasm" output_dir = "dist/wasm" # Example WASM modules configuration modules = [ { name = "compute", source = "compute/src/lib.rs", lang = "rust" }, # { name = "graphics", source = "graphics/main.c", lang = "c" }, # { name = "utils", source = "utils/index.ts", lang = "assemblyscript" } ] [wasm.rust] # Rust-specific WASM settings toolchain = "wasm-pack" target = "web" optimization = "release" features = ["wee_alloc"] # Common optimization feature scope = "" [wasm.c] # C/C++ specific settings optimization = "O3" exports = ["main", "compute"] extra_args = ["-s", "ALLOW_MEMORY_GROWTH=1"] [wasm.assemblyscript] # AssemblyScript specific settings optimize = true debug = false runtime = "stub" [wasm.go] # Go specific settings build_tags = [] extra_args = [] [wasm.optimization] # WASM optimization settings use_wasm_opt = true opt_level = 3 shrink_level = 2 enable_simd = true enable_threads = false [wasm.loader] # JavaScript loader generation auto_load = true loader_name = "wasm-loader.js" streaming = true fallback = true