In an inherited polymer 1.0 project the setup involves a gruntfile which calls, among other things, bower to install the necessary resources. However, in the later steps, some files cannot be found and the grunt task fails. I am new to both bower and grunt and feeling a little lost.
The file in question that cannot be found is myproject\components\polymer\polymer-mini.html, though there are more in similar positions which I found out by copying the file there by hand.
My first step was to isolate the bower install task and watch it while it was working. This is its configuration in the gruntfile.js:
bower: { install: { options: { targetDir: './components', layout: 'byType', install: true, verbose: false, cleanTargetDir: true, cleanBowerDir: true, bowerOptions: {} } } } By pausing the execution after single steps in verbose mode I found the following to happen during installation:
- the old
myproject/componentsfolder is deleted if it exists - files are created as normal in a
myproject/bower_componentsfolder - files are then copied to the targetDir
myproject/components - however, not all files seem to arrive there
myproject/bower_componentsis deleted after copying
Comparing the contents of myproject/bower_components and myproject/components reveals that many files present in the original folder are missing in the target one. For example, the mentioned myproject/components/polymer only contains a polymer.html - however, there are seven files in myproject/bower_components/polymer, including the missing polymer-mini.html.
Apparently, something filters what is copied to the targetDir and what isn't.
Can I influence this in any way or is this setup even correct as it is now? I have seen grunt-bower-task and Polymer but cannot make much of it - except that the accepted solution apparently copies everything by hand after the installation of bower_components. Surely, there must be a better way?