27

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.

pricecreations
  • 273
  • 3
  • 8
  • Please let us know what you have tried. What was your expected result, what actually happened? – nwaltham Jun 24 '15 at 13:59
  • He has tried `polymer-loader`. as he said, it works with Polymer 0.5, but not 1.0. – Alon Amir Aug 16 '15 at 15:22
  • The loader is broken because of the API change in 1.0 & 0.8, and unfortunately nobody is going to fix it as no PR queued so far. May be you can start without loader first: require the component js files & assets as general js files do, then npm install the libraries and setup the config file. – vincicat Aug 21 '15 at 17:20
  • The last update to polymer-loader (https://www.npmjs.com/package/polymer-loader) was pushed at least 3 months before Polymer 1.0 was published (http://googledevelopers.blogspot.com/2015/05/polymer-10-released.html) – user3076252 Sep 14 '15 at 21:51
  • I've built a package to handle polymer/webcomponents files and html imports (with code reload support) https://github.com/aruntk/wc-loader. check out. Demo https://github.com/aruntk/polymer-webpack-demo – tkay Dec 28 '16 at 11:32

3 Answers3

1

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.

Dodo
  • 323
  • 1
  • 8
0

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
})
CALL ME TZ
  • 209
  • 1
  • 4
  • 10
0

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';
Daniel Birowsky Popeski
  • 8,752
  • 12
  • 60
  • 125