Polymer Project Builder
Polymer Project Builder is a utility to generate a single bundled file optimized for production from a set of HTML imports using
It is meant to be used in projects that don't match a typical Polymer project structure, for instance, where a shell is not present, or simply where the default output of the
polymer build command does not fit well.
npm i polymer-project-builder
Command line usage
Build a project (configuration file required):
Polymer Project Builder requires a configuration file called
.polymerprojectrc placed in the directory where the command is executed or in a parent directory. File paths are relative to the working directory.
The configuration file follows the
polymer.json specification with some differences:
shellis not required.
entrypointcan be the main entrypoint of an application (
index.html) or a file that only contains HTML imports that should be bundled into a single file. For the first case, the file should contain at least one HTML import.
destallows to set the destiny path. This property is not present in the original
polymer.jsonspec and the destiny path is set to
build/[build-name | default].
bundleFileNameallows to set the name for the HTML bundled file. Defaults to
entrypointif not set.
Object) instead of
Array). Polymer Project Builder generates only one build.
build property in the configuration file accepts an object with the same options for a build using
polymer build plus two additional properties:
Boolean) Set to
Object) An object with autoprefixer options like
Example configuration file
Import the module and create an instance with the same options used for the command line tool.
build() method returns a resolved promise when all the build steps have finished.
const PolymerProjectBuilder = ;const config =// your build options;const builder = config;builder;
If you want to contribute, please read the CONTRIBUTING.md.
See the list of contributors who participated in this project.
This project is licensed under the MIT License.