@gluonjs/compiler / packages/compiler/src / GluonSfcBlock
Interface: GluonSfcBlock
Properties
attributes
readonlyattributes:Readonly<Record<string,string|true>>
content
readonlycontent:string
end
readonlyend:number
range
readonlyrange:Readonly<{end:number;start:number; }>
start
readonlystart:number
type
readonlytype:"template"|"style"|"script"
Example
Inspect a readonly parsed block and its original source range:
import { parseGluonSfc, type GluonSfcBlock } from '@gluonjs/compiler';
const block: GluonSfcBlock | undefined = parseGluonSfc('<style id="card">.card {}</style>', 'Card.gluon').blocks[0];
console.log(block?.type, block?.attributes, block?.range);