Currently I am trying to use Webpack (http://webpack.github.io/) as my module builder and wanted to see if anyone has done this yet with Polymer v1.0. There is a webpack loader called polymer-loader (https://www.npmjs.com/package/polymer-loader) but it does not work with anything higher than Polymer v0.5.
Polymer 1.0 + Webpack
Asked Answered
Unfortunately, Polymer 1.0 is presently unsupported by polymer-loader
due to an API change. It is possible that this may be repaired in the near future, but in the meantime you may have to resort to either a different package or builder. Hopefully a fix becomes available soon.
Thank god. Who on earth wants to use Webpack? –
Phenazine
I make a simple solution with polymer-ext
var PolymerExt = require('polymer-ext')
var t = require('raw!./test.tmpl')
var s = require('raw!./test.css')
PolymerExt({
is: 'card-panel',
template: t,
style: s,
... // other polymer options
})
I just succeeded by means of this loader:
https://github.com/aitoroses/vulcanize-loader
Unobvious thing is that i had to install the webcomponent that i wanted through bower (yarn does the job too). After that, manually reference it inside manually created importer.html
file, and then at the end, reference that importer.html
file inside your js module:
import 'vulcanize!./importer.html';
© 2022 - 2024 — McMap. All rights reserved.
polymer-loader
. as he said, it works with Polymer 0.5, but not 1.0. – Tape