Registry / web-framework / polymer-webpack-loader

polymer-webpack-loader

JSON →
library3.1.0jsnpmunverified

Webpack loader for Polymer (v3 and above) that processes HTML template elements, minifying HTML and including images, fonts, and imported stylesheets in the webpack dependency graph. Version 3.1.0 is the latest, with an active maintenance status. The loader integrates with webpack 2–4 and supports chaining with babel-loader. Differentiator: enables using Polymer 3 components within a webpack build system, handling HTML imports and template optimizations. Alternative to polymer-build or direct HTML imports, it bridges Polymer's component model with webpack's module bundling.

npm install polymer-webpack-loader
INSTALL
IMPORT
SIG · POLYMER-WEBPACK-LO
P
polymer-webpack-loader
web-frameworkjavascriptv3.1.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

polymer-webpack-loader
✓ import polymerWebpackLoader from 'polymer-webpack-loader'
✗ const polymerWebpackLoader = require('polymer-webpack-loader')
ESM default export available; CommonJS require also works. Typically used in webpack config, not in app code.
PolymerWebpackLoader
✓ import { PolymerWebpackLoader } from 'polymer-webpack-loader'
Named export for the loader class; rarely needed directly.

Minimal webpack configuration for processing Polymer HTML components with polymer-webpack-loader.

// webpack.config.js const webpack = require('webpack'); module.exports = { entry: './src/index.js', output: { filename: 'bundle.js', path: __dirname + '/dist' }, module: { rules: [ { test: /\.html$/, use: [ { loader: 'polymer-webpack-loader' } ] } ] } };
Debug
Known issues
deprecatedPolymer 2 branch is deprecated; use version 3.x for Polymer 3.
fix
Upgrade to Polymer 3 and polymer-webpack-loader 3.x.
affects: >=1.0 <3.0
gotchaWebcomponent polyfills must be loaded in specific order to avoid 'Failed to construct HTMLElement' errors.
fix
Use the demo index.ejs ordering: polyfills before main bundle.
affects: >=3.0
breakingWebpack 5 support not officially added; may require adjustments.
fix
Use webpack 4 or consider alternatives like @polymer/webpack-loader for webpack 5.
affects: >=3.0
gotchaHTML-loader options passed via htmlLoader must be compatible with the installed html-loader version.
fix
Check html-loader documentation and ensure options are correct.
affects: >=3.0
Errors
Common errors & fixes
Uncaught TypeError: Failed to construct 'HTMLElement': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
Web component polyfills loaded out of order or missing.
fix
Load polyfills in correct sequence before main bundle (see demo/src/index.ejs).
Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type.
polymer-webpack-loader not applied to .html files.
fix
Add the loader rule for test: /\.html$/ in webpack config.
Error: Polymer entry point must be an HTML file.
Entry point is a JS file instead of HTML.
fix
Set entry to an HTML file that imports components.
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies
webpackrequiredpeer dependency for webpack loader integration
Agent activity
2 hits · last 30 days
node
2
Resources
polymer-webpack-loader — npm install polymer-webpack-loader · libregistry