Browser without a build step
Run Aurelia 2 directly in the browser with a module script and CDN imports.
What to include
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Aurelia without a build step</title>
<link rel="modulepreload" href="https://esm.sh/aurelia@2.0.0-rc.1" crossorigin>
</head>
<body>
<app-root></app-root>
<script type="module">
import { Aurelia, CustomElement } from 'https://esm.sh/aurelia@2.0.0-rc.1';
const AppRoot = CustomElement.define({
name: 'app-root',
template: `
<h1>\${message}</h1>
<input value.bind="message">
<p>You typed: \${message}</p>
`,
}, class {
message = 'Hello from Aurelia';
});
await new Aurelia()
.app({
component: AppRoot,
host: document.querySelector('app-root'),
})
.start();
</script>
</body>
</html>Pin package versions
Add official Aurelia packages
Enhance existing HTML
Browser-only constraints
Last updated
Was this helpful?