Parcel2's Aurelia2 transformer for js/ts/html assets.
For the latest stable version:
npm i -D @aurelia/parcel-transformer
For our nightly builds:
npm i -D @aurelia/parcel-transformer@dev
In .parcelrc
:
{
"extends": "@parcel/config-default",
"transformers": {
"*.js": ["@aurelia/parcel-transformer", "..."], // Or "*.ts" for TypeScript project
"*.html": ["@aurelia/parcel-transformer", "..."]
}
}
Optionally, add config into your project's package.json
:
{
"aurelia": {
"defaultShadowOptions": { "mode": "open" },
"useCSSModule": false
}
}
For apps in TypeScript, an extra typing definition is required for html module. You can add following file to your typing folder.
html.d.ts
declare module '*.html' {
import { IContainer } from '@aurelia/kernel';
import { BindableDefinition } from '@aurelia/runtime';
export const name: string;
export const template: string;
export default template;
export const dependencies: string[];
export const containerless: boolean | undefined;
export const bindables: Record<string, BindableDefinition>;
export const shadowOptions: { mode: 'open' | 'closed'} | undefined;
export function register(container: IContainer);
}