Search code examples
polymerpaper-elementscore-elements

Polymer - Vulcanize core-elements and paper elements to one file?


What would be the best way to concatenate core-elements and paper elements from Polymer? As one large file? two seperate ones (core & paper)? a smaller division (5+ or 10 + or 20+)?

Im trying to reduce the number of imports per web page for a web-app and cant decide how to go about organizing polymer web-component imports. Any advice? / best way to use Vulcanization?


Solution

  • The easiest way is to vulcanize everything together. Add core-elements + paper-elements in one import that your index.html use:

    elements.html:

    <link rel="import" href="core-elements.html">
    <link rel="import" href="paper-elements.html">
    

    Then:

    vulcanize elements.html -o elements.vulcanize.html --csp --inline --strip
    

    For Polymer 1.0, you'll need the latest version of vulcanize and the flags have changed a bit: https://github.com/Polymer/vulcanize/releases