yeoman / generator-polymer

Scaffold out a Polymer project
http://polymer-project.org
926 stars 150 forks source link

grunt serve:dist doesn't render core-scaffold but grunt serve does #112

Closed toadkicker closed 9 years ago

toadkicker commented 9 years ago

Greetings!

I started a project and got ready to deploy it but for some reason I'm not seeing UI when I run grunt serve:dist or doing grunt build and serving it with Node. polymer-ready fires though, and I've checked that the server is sending the files I expect but all I'm getting is the black background color set in body{}. I'm using app-router, and I can see in the web inspector that the home-page route doesn't append a child element (home-page). The thing is that serving the site using plain grunt serve works perfectly. I'm not sure what the difference is as they seem to run the same tasks.

The project is here: https://github.com/CascadeSD/www if you have a chance to pick out anything glaringly obvious.

toadkicker commented 9 years ago

aaand as soon as i post this I fixed it.

cherukumilli commented 9 years ago

I am having the exact same problem. Can you please tell me how you fixed it?

toadkicker commented 9 years ago

https://github.com/CascadeSD/www/commit/3f44080ecd0f7a8f1f3f2464a293583f8e8bb8ac#diff-b9707fe88797285e93483456d1389b61L17

I actually removed the build:vulcanize tags here and in my gruntfile used */.html for the file list. Since everything is under the 'elements' directory anyway, this seems to work fine.

robdodson commented 9 years ago

Did you try placing the import for app-router inside elements.html. The elements.html file is supposed to be where you place all of your imports so they can be vulcanized into a single bundle.

toadkicker commented 9 years ago

I know the generator is setup to insert into elements.html but I always said no. Eventually after a couple of pages were generated I was thinking "why do I need elements.html if grunt is doing this?". I was expecting usemin to inject the imports but I didn't see that happening. Plus I just wanted to glob whatever I have in the elements folder without having to declare every import.

toadkicker commented 9 years ago

So given a large application, how would you structure it? What tool(s) would work best for polymer and vulcanize? Wiredep? I just would prefer to automate importing when many components are being pulled in vs manually declaring each one.

I'm wanting a project structure like:

elements/
layouts/
pages/
styles/
vendor/(js/, styles/, etc)

I think partly this generator is aimed at building out single-purpose components and I'm using it to make entire applications.

robdodson commented 9 years ago

The generator is designed for building apps, but the current way to go about that is to declare all of the imports that you're using. Let's say you have three big components to your site, you could import those components in elements.html. Then inside each component, there are more imports for that component's dependencies.