Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default
✓ import polymerTranspiler from 'polymer-transpiler'
✗ const polymerTranspiler = require('polymer-transpiler')
Package is ESM-only, no CommonJS export.
transpile
✓ import { transpile } from 'polymer-transpiler'
✗ const { transpile } = require('polymer-transpiler')
Named export for programmatic use.
PolymerTranspiler
✓ import PolymerTranspiler from 'polymer-transpiler'
✗ import { PolymerTranspiler } from 'polymer-transpiler'
Default export is the class.
Transpile a Polymer 1 element string to Polymer 2 class syntax
import polymerTranspiler from 'polymer-transpiler';
// Example: transpile a single Polymer 1 element file
const input = `
<dom-module id="my-element">
<template><span>{{text}}</span></template>
<script>
Polymer({
is: 'my-element',
properties: { text: { type: String } }
});
</script>
</dom-module>
`;
const output = polymerTranspiler.transpile(input, { extends: 'Polymer.Element' });
console.log(output);
// Output will be ES6 class extending Polymer.Element
polymer-transpiler --version
Debug
Known issues
breakingCLI name changed from 'poly-transpiler' to 'polymer-transpiler' in v1.1.0-alphafixUpdate scripts and references to use 'polymer-transpiler' instead of 'poly-transpiler'
affects: >=1.1.0-alpha <1.1.0
deprecatedPolymer itself is deprecated; this transpiler is only relevant for legacy codebasesfixMigrate to modern web component frameworks (Lit, etc.)
affects: >=0
gotchaAlpha stability: anything can change, no semver in alpha, may break without noticefixPin to a specific version and test thoroughly before using in production
affects: <1.0.0
Errors
Common errors & fixes
Cannot find module 'polymer-transpiler'
Package not installed globally or missing from node_modules
fixRun: npm install -g polymer-transpiler
TypeError: polymerTranspiler.transpile is not a function
Incorrect import or using default import as named object
fixUse: import polymerTranspiler from 'polymer-transpiler' then call polymerTranspiler.transpile()
Error: The specified path does not contain Polymer components
CLI path option points to a directory without Polymer 1 elements
fixProvide a valid path with .html files containing Polymer({}) calls Audit
Dependencies
No dependency data recorded yet.