Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

solution for identifying and removing inlined files (plus other redundant files)? #10

Open
davidmaxwaterman opened this issue Sep 13, 2014 · 0 comments

Comments

@davidmaxwaterman
Copy link

My Gruntfile.js works like this :

  1. copy all files from app/ to build/
  2. run grunt-vulcanize on build/index.html
  3. remove build/index.html
  4. copy build/index-csp.html to build/index.html
  5. remove build/index-csp.html

It's a bit long-winded, but it works.

However, the vulcanize step reads in lots of files into both index-csp.html and index-csp.js. So, while those files are still in build/ somewhere (mostly in build/bower_components/, but also our own polymer elements have been inlined) and so those files are no longer needed.

So, it would be really nice to be able to somehow remove those files so they're not included in the app.

Is it possible that grunt-vulcanize somehow 'output' a list of files to remove, or perhaps have an option to remove any files it inlines?

It sounds plausible, but there are plenty of other files that aren't needed too. Just take the bower_components/paper_button/ directory - I see .bower.json, README.md, bower.json, demo.html, demo2.html, index.html and metadata.html, as well as, paper-button.html. IINM, I still need the css file, so I can't remove that. I noticed a closed issue that talked about concatenating those - that's not possible, but it is possible to add each individual css back into its corresponding html file, I presume, which might mean we can remove the whole bower_components/paper-button/ directory after running vulcanize. I do see the 'inline' option but that also does script - perhaps there could be an option for just style.

Anyway, I'm not sure what the 'correct' solution is to this problem. Perhaps there's a better way of building which avoids the problem to begin with.

Thoughts?

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

No branches or pull requests

2 participants