polymer-loader is used to convert HTML files into JavaScript files. To configure the loader, use the following code with webpack.config.js:
{
test: /.html$/,
include: Condition(s) (optional),
exclude: Condition(s) (optional),
options: {
ignoreLinks: Condition(s) (optional),
ignorePathReWrite: Condition(s) (optional),
processStyleLinks: Boolean (optional),
htmlLoader: Object (optional)
},
loader: 'polymer-webpack-loader'
},
The polymer-webpack-loader phrase allows the developer to write HTML, CSS, and JavaScript code together as polymer elements in single documents—for instance, while still being able to use the full Webpack system, including module bundling and code splitting.