There is currently an open bug on running polymer build
on elements: https://github.com/Polymer/polymer-cli/issues/338
Does anyone have some Grunt scripts (or description of what exactly it does) for accomplishing the same?
The Polymer build tools ensure that your applications can run across multiple and older browsers. Polymer 2.0 is written in ES6, for more legible, maintainable, and modular code. For compatibility with older browsers, the Polymer build tools must compile ES6 to ES5.
Polymer elements are a set of visual and non-visual elements designed to work with the layout, user interaction, selection, and scaffolding applications. These include everything from a simple button to a dialog box with neat visual effects.
Polymer adds a set of features to the basic custom element: Instance methods to handle common tasks. Automation for handling properties and attributes, such as setting a property based on the corresponding attribute. Creating shadow DOM trees for element instances based on a supplied template.
The problem is on the element default imports. The tree of the directorie should be:
element/
bower_components/
build/
demo/
teste/
bower.json
element-test.html
index.html
READEME.md
The imports on index.html and elemt-test.html are calling for "../dependency", but the correct is to call "bower_components/dependency", it will work if you just fix the paths.
I ended up using the Yeoman generator from: https://github.com/seaneking/generator-polymer-element
It has a very nice list of features set up in the Gulp build system. The build system includes Babel ES6 transpiling, Rollup, PostCSS, inline asset processing, and BrowserSync.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With