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-loaderVerified import paths — ran on the pinned version, not inferred.
Minimal webpack configuration for processing Polymer HTML components with polymer-webpack-loader.
Upgrade to Polymer 3 and polymer-webpack-loader 3.x.
Use the demo index.ejs ordering: polyfills before main bundle.
Use webpack 4 or consider alternatives like @polymer/webpack-loader for webpack 5.
Check html-loader documentation and ensure options are correct.
Load polyfills in correct sequence before main bundle (see demo/src/index.ejs).
Add the loader rule for test: /\.html$/ in webpack config.
Set entry to an HTML file that imports components.