{"id":22041,"library":"rollup-plugin-glimmer-template-tag","title":"rollup-plugin-glimmer-template-tag","description":"A Rollup plugin for compiling `<template>` tags in `.gjs` and `.gts` files used by Ember.js v2 addons. Version 0.4.1 requires Node 16+ and Rollup 3+. It is ESM-only and must be paired with Babel's `ember-template-imports` plugin. Key differentiator: it enables the new Ember `<template>` tag syntax in build pipelines, handling both JavaScript and TypeScript via separate transforms with `rollup-plugin-ts`.","status":"active","version":"0.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/NullVoxPopuli/rollup-plugin-glimmer-template-tag","tags":["javascript"],"install":[{"cmd":"npm install rollup-plugin-glimmer-template-tag","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-glimmer-template-tag","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-glimmer-template-tag","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for Babel transform of `<template>` tags","package":"@babel/core","optional":false},{"reason":"Peer dependency for Ember runtime support","package":"ember-source","optional":false},{"reason":"Babel plugin that transforms `<template>` into valid JavaScript/TypeScript","package":"ember-template-imports","optional":false}],"imports":[{"note":"Package is ESM-only; CommonJS require will throw. Use ESM imports.","wrong":"const { glimmerTemplateTag } = require('rollup-plugin-glimmer-template-tag')","symbol":"glimmerTemplateTag","correct":"import { glimmerTemplateTag } from 'rollup-plugin-glimmer-template-tag'"},{"note":"Default export is the same as named export; both work. Named export is more explicit.","wrong":"import { glimmerTemplateTag } from 'rollup-plugin-glimmer-template-tag'","symbol":"default","correct":"import glimmerTemplateTag from 'rollup-plugin-glimmer-template-tag'"},{"note":"TypeScript users: import the named symbol; no separate type import needed.","wrong":"","symbol":"glimmerTemplateTag","correct":"import { glimmerTemplateTag } from 'rollup-plugin-glimmer-template-tag'"}],"quickstart":{"code":"// rollup.config.mjs\nimport { glimmerTemplateTag } from 'rollup-plugin-glimmer-template-tag';\n\nexport default {\n  plugins: [\n    glimmerTemplateTag(),\n    // ... other plugins\n  ]\n};","lang":"javascript","description":"Shows basic Rollup configuration to add `<template>` support for gjs/gts files."},"warnings":[{"fix":"Convert config to ESM (.mjs) or use dynamic import().","message":"ESM-only: CommonJS require will fail","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Add the plugin to your Babel configuration as shown in the README.","message":"Must add Babel plugin 'ember-template-imports/src/babel-plugin' in babel.config.js","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set typescript({ transpiler: 'babel', transpileOnly: true }) in rollup config.","message":"With TypeScript, need to set transpileOnly: true in rollup-plugin-ts","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Run type-checking separately via glint; ensure source files have no type errors.","message":"Type errors from <template> are copied into generated .d.ts files, causing downstream errors","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Upgrade to Node 18 or 20.","message":"Node 16 EOL; future versions may drop support","severity":"deprecated","affected_versions":"<=0.4.1"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Change to import { glimmerTemplateTag } from 'rollup-plugin-glimmer-template-tag' in .mjs file.","cause":"Using CommonJS require with ESM-only package","error":"require() of ES Module not supported"},{"fix":"Add 'ember-template-imports/src/babel-plugin' to Babel plugins list.","cause":"Missing Babel plugin 'ember-template-imports'","error":"Template tag not transformed: unexpected token '<'"},{"fix":"Set transpileOnly: true in rollup-plugin-ts configuration.","cause":"TypeScript declaration errors from template not being transpiled yet","error":"ts(2307) Cannot find module '...' or its corresponding type declarations."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}