Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with Web Components #547

Closed
wprater opened this issue Oct 22, 2014 · 17 comments
Closed

Usage with Web Components #547

wprater opened this issue Oct 22, 2014 · 17 comments
Labels

Comments

@wprater
Copy link

wprater commented Oct 22, 2014

Any examples of how one can use this with Web Components, or say, Polymer?

@jhnns
Copy link
Member

jhnns commented Oct 22, 2014

I'm curious about that too 👍

@wprater
Copy link
Author

wprater commented Oct 23, 2014

@jhnns I was going to start by forking this https://github.com/vuejs/vue-loader
just need to figure out how to split bundles and if that'll be supported with the imports.

@cliren
Copy link

cliren commented Nov 7, 2014

I have a simple polymer element with html imports, how can I use webpack to bundle it into a component?

@christian-raedel
Copy link

👍

@jjzazuet
Copy link

Also interested here. Any comments? Thanks!

@VictorBlomberg
Copy link

polymer-loader seems to have some support, but as of now requires the JavaScript Polymer(...) registration in a separate JavaScript file, which makes it somewhat incompatible with Polymer Paper Elements collection, if I understand it correctly. I've filed an issue JonDum/polymer-loader#1, and I plan to look into it.

There's also a related issue in the html-loader repo, webpack-contrib/html-loader#14.

Have anyone here made any progress?

@jhnns
Copy link
Member

jhnns commented Mar 10, 2015

This is probably also related to #860 since polymer components can host html, js and css?

@VictorBlomberg
Copy link

Yes, it seems highly relevant. Asked OP about current status, with any luck it could be a good start.

@aabluedragon
Copy link

Any news / plans? Polymer is now 1.0, and still can't be used nicely with web pack.

A loader that functions similar to "vulcanize" might be enough (inline all <link rel="import" href="....html"> tags recursively in the output bundle).
Added a bounty to a stack overflow question: http://stackoverflow.com/q/31028374/230637

@yutingzhao1991
Copy link

I make a simple solution with polymer-ext

@cookiengineer
Copy link

cookiengineer commented Apr 30, 2016

Following this issue and looking at the code inside polymer-loader, I am a bit concerned.

Is this the proposed solution?

The problem I have is the mixup between the document objects. There are actually two, one for the HTML Imports component and one for the main javascript runtime (where the library is added as a property to window). So we are talking about document !== document.currentScript.ownerDocument where currentScript is inside an external document that is not traceable from or attached to the main window or document.

How would someone write a loader if his code relies on those two objects in order to have a proper supported Shadow DOM implementation?

I'm asking because the code for my library fytoJS looks like this and I have no single clue where to start with webpack.

@o3oSupport
Copy link

Loaders should do only a single task , but those loaders do actually like a manager.How terrible they are!
Somehthing should be done to support inline web components

@aruntk
Copy link

aruntk commented Dec 27, 2016

I've built a package to handle polymer/webcomponents files and html imports (with HMR support)

https://github.com/aruntk/wc-loader. check out.

Demo https://github.com/aruntk/polymer-webpack-demo

@Shyam-Chen
Copy link

https://github.com/rnicholus/web-components-loader

@vardius
Copy link

vardius commented May 6, 2017

I've setup a simple boilerplate webpack2 project for web components. Hello world example with template. You can easy add polymer to it.

@jrunning
Copy link

jrunning commented Jul 20, 2017

For those following this thread, webpack-contrib/polymer-webpack-loader is worth taking a look at. @robdodson did a writeup on Medium: How to use Polymer with Webpack.

@alexander-akait
Copy link
Member

Thanks everyone! Please use https://github.com/webpack-contrib/polymer-webpack-loader for web components

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests