Overview
ThecustomSettings property in the Config object allows you to configure:
- Language-specific compiler options
- CSS processor settings
- Template engine behavior
- Module resolution and import mapping
- Script loading behavior
- CDN preferences
Template Settings
Configure template engine behavior.
Data object passed to template engines.Available in templates like Handlebars, EJS, Nunjucks, Liquid, etc.Then in a Handlebars template:
If
false, disables pre-rendering for template languages.By default, templates are rendered at compile time. Set to false to render at runtime.Script Loading
Specifies the script type attribute for the compiled script.Available values:
"module"(default for most languages)"application/javascript""application/ecmascript""text/javascript""text/ecmascript"""(no type attribute)
Module Resolution
Enable automatic import mapping for bare module specifiers.When
true, bare imports like import React from 'react' are automatically resolved using the configured CDN.Custom import maps for module resolution.This is similar to the top-level
imports config property but scoped to custom settings.Automatically convert CommonJS modules to ES modules.Useful when importing packages that use
require() and module.exports.Sets the default CDN for resolving bare module imports.Available CDNs:
"jspm""skypack""jsdelivr"(default)"fastly.jsdelivr""gcore.jsdelivr""jsdelivr.esm""esm.run""esm.sh""esbuild""bundle.run""unpkg""statically"
Custom TypeScript type declarations for IntelliSense.Same as the top-level
types property but scoped to custom settings.Language-Specific Settings
Each language can have its own custom settings object. The structure depends on the language compiler.TypeScript
Babel
Python (Pyodide)
Tailwind CSS
PostCSS
UnoCSS
Vue
Svelte
Solid
Complete Examples
React with TypeScript and Tailwind
Template with Data
Custom CDN and Module Resolution
Python with Packages
Setting via URL Parameters
Custom settings can be configured via URL parameters using dot notation:Runtime Configuration
Custom settings can be modified at runtime:Language Documentation
For detailed language-specific compiler options, refer to the individual language documentation:TypeScript
TypeScript compiler options
Tailwind CSS
Tailwind configuration
PostCSS
PostCSS plugins and settings
Python
Python package configuration
Best Practices
Use Type Definitions
Use Type Definitions
When working with TypeScript, provide custom type definitions in
customSettings.types for better IntelliSense support.Minimize Package Imports
Minimize Package Imports
Only load necessary packages to keep bundle size small and improve load times.
CDN Selection
CDN Selection
Choose a CDN based on your needs:
esm.sh: Automatic TypeScript types, good for developmentjsdelivr: Fast, reliable, good for productionskypack: Optimized builds, good balance
Template Data Validation
Template Data Validation
Validate template data to prevent runtime errors in template rendering.
Related Documentation
Configuration Object
Complete Config reference
Module Resolution
Learn about module imports and CDNs
Languages
Supported languages and their options
CSS Processors
CSS processor configuration