Registry /
web-framework / rollup-plugin-sham-ui-templates
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–223 runs
build_error
glibcnode 18–223 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default
✓ import shamUICompiler from 'rollup-plugin-sham-ui-templates'
✗ const shamUICompiler = require('rollup-plugin-sham-ui-templates')
Package is ESM-only; CJS require will fail.
default
✓ import shamUICompiler from 'rollup-plugin-sham-ui-templates'
✗ import { shamUICompiler } from 'rollup-plugin-sham-ui-templates'
Export is default, not named.
call expression
✓ shamUICompiler({ extensions: ['.sht'] })
✗ new shamUICompiler({ extensions: ['.sht'] })
Plugin is invoked as a function, not with 'new'.
Shows Rollup configuration using two shamUICompiler instances for .sht and .sfc files, with Babel processing.
// rollup.config.js
import shamUICompiler from 'rollup-plugin-sham-ui-templates';
import { babel } from '@rollup/plugin-babel';
export default {
input: 'src/main.js',
output: {
file: 'dist/bundle.js',
format: 'iife',
sourcemap: true
},
plugins: [
shamUICompiler({
extensions: ['.sht']
}),
shamUICompiler({
extensions: ['.sfc'],
compilerOptions: {
asModule: false,
asSingleFileComponent: true
}
}),
babel({
extensions: ['.js', '.sht', '.sfc'],
exclude: ['node_modules/**'],
babelHelpers: 'bundled'
})
]
};
Debug
Known issues
gotchaBoth .sht and .sfc must be added to Babel extensions for transformation.fixInclude extensions: ['.js', '.sht', '.sfc'] in @rollup/plugin-babel config.
affects: >=1.0.0
gotchaPlugin is ESM-only; CommonJS require will fail with 'ERR_REQUIRE_ESM'.fixUse import syntax or switch to an ESM-compatible environment.
affects: >=1.0.0
gotchaDefault export is a function, not a class; using 'new' will cause runtime error.fixCall shamUICompiler(...) without 'new'.
affects: >=1.0.0
deprecatedNo deprecated versions known.
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported.
Using CommonJS require on an ESM-only package.
fixReplace require() with import or set type: 'module' in package.json.
TypeError: shamUICompiler is not a constructor
Using 'new' on a function export that is not a class.
fixRemove 'new' and call shamUICompiler(...) directly.
Audit
Dependencies
@rollup/plugin-babelrequiredBabel must be used to transform compiled templates