ember-template-tag

instead of using ember-template-imports to find, parse & transform templates, this can be used.

ISC 34 个版本
安装
npm install ember-template-tag
yarn add ember-template-tag
pnpm add ember-template-tag
bun add ember-template-tag
README

ember-template-tag

instead of using ember-template-imports to find, parse & transform templates, this can be used.

const { parseTemplates, preprocessEmbeddedTemplates, transform } = require('ember-template-tag');
const { TEMPLATE_TAG_NAME, TEMPLATE_LITERAL_IDENTIFIER, TEMPLATE_LITERAL_MODULE_SPECIFIER } = require('ember-template-tag');

the output of parseTemplates is

<template>Hello!</template>
[
    {
        "contentRange": [
            10,
            16,
        ],
        "contents": "Hello!",
        "endRange": {
            "end": 27,
            "start": 16,
        },
        "range": [
            0,
            27,
        ],
        "startRange": {
            "end": 10,
            "start": 0,
        },
        "tagName": "template",
        "type": "template-tag",
    },
]

to transform

const { transform } = require('ember-template-tag');
const transformed = transform('...')
版本列表
2.3.16 2024-02-14
2.3.15 2023-10-02
2.3.14 2023-09-05
2.3.13 2023-09-05
2.3.12 2023-09-05
2.3.11 2023-09-05
2.3.10 2023-09-04
2.3.9 2023-09-03
2.3.8 2023-08-21
2.3.7 2023-08-20
2.3.6 2023-08-20
2.3.5 2023-08-20
2.3.4 2023-08-18
2.3.3 2023-08-17
2.3.2 2023-08-16
2.3.1 2023-08-08
2.3.0 2023-08-07
2.2.4 2023-08-04
2.2.3 2023-08-01
2.2.2 2023-08-01
2.2.1 2023-07-31
2.2.0 2023-07-27
2.1.0 2023-07-27
2.0.12 2023-07-26
2.0.11 2023-07-25
2.0.10 2023-07-25
2.0.9 2023-07-25
2.0.8 2023-07-25
2.0.7 2023-07-25
2.0.6 2023-07-25
2.0.5 2023-07-25
2.0.3 2023-07-25
2.0.2 2023-07-25
2.0.0 2023-07-24