{"id":22218,"library":"rollup-plugin-sham-ui-templates","title":"rollup-plugin-sham-ui-templates","description":"Rollup plugin that compiles sham-ui template files (.sht, .sfc) during bundling. Version 1.1.0 is current. Supports two file types: standard templates and single-file components. Requires @rollup/plugin-babel for transformation. Minimal configuration; designed specifically for sham-ui projects.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/sham-ui/rollup-plugin-sham-ui-templates","tags":["javascript","rollup-plugin","sham-ui"],"install":[{"cmd":"npm install rollup-plugin-sham-ui-templates","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-sham-ui-templates","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-sham-ui-templates","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Babel must be used to transform compiled templates","package":"@rollup/plugin-babel","optional":false}],"imports":[{"note":"Package is ESM-only; CJS require will fail.","wrong":"const shamUICompiler = require('rollup-plugin-sham-ui-templates')","symbol":"default","correct":"import shamUICompiler from 'rollup-plugin-sham-ui-templates'"},{"note":"Export is default, not named.","wrong":"import { shamUICompiler } from 'rollup-plugin-sham-ui-templates'","symbol":"default","correct":"import shamUICompiler from 'rollup-plugin-sham-ui-templates'"},{"note":"Plugin is invoked as a function, not with 'new'.","wrong":"new shamUICompiler({ extensions: ['.sht'] })","symbol":"call expression","correct":"shamUICompiler({ extensions: ['.sht'] })"}],"quickstart":{"code":"// rollup.config.js\nimport shamUICompiler from 'rollup-plugin-sham-ui-templates';\nimport { babel } from '@rollup/plugin-babel';\n\nexport default {\n    input: 'src/main.js',\n    output: {\n        file: 'dist/bundle.js',\n        format: 'iife',\n        sourcemap: true\n    },\n    plugins: [\n        shamUICompiler({\n            extensions: ['.sht']\n        }),\n        shamUICompiler({\n            extensions: ['.sfc'],\n            compilerOptions: {\n                asModule: false,\n                asSingleFileComponent: true\n            }\n        }),\n        babel({\n            extensions: ['.js', '.sht', '.sfc'],\n            exclude: ['node_modules/**'],\n            babelHelpers: 'bundled'\n        })\n    ]\n};","lang":"javascript","description":"Shows Rollup configuration using two shamUICompiler instances for .sht and .sfc files, with Babel processing."},"warnings":[{"fix":"Include extensions: ['.js', '.sht', '.sfc'] in @rollup/plugin-babel config.","message":"Both .sht and .sfc must be added to Babel extensions for transformation.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use import syntax or switch to an ESM-compatible environment.","message":"Plugin is ESM-only; CommonJS require will fail with 'ERR_REQUIRE_ESM'.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Call shamUICompiler(...) without 'new'.","message":"Default export is a function, not a class; using 'new' will cause runtime error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"","message":"No deprecated versions known.","severity":"deprecated","affected_versions":""}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Replace require() with import or set type: 'module' in package.json.","cause":"Using CommonJS require on an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported."},{"fix":"Remove 'new' and call shamUICompiler(...) directly.","cause":"Using 'new' on a function export that is not a class.","error":"TypeError: shamUICompiler is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}