Closed daredevil82 closed 8 years ago
But you can already easily do this on your own in about 1 line of code. wiredep already returns this information:
require('fs').writeFile(JSON.stringify(require('wiredep')({ src: 'index.html' }), null, 2));
This information is already provided programmatically. Many build tools already use this.
Wiredep is great for development environments and projects that don't have to concern themselves with minimizing HTTP requests for resources. However, for most other projects, the lack of a centralized JSON file that contains the paths and script filenames is a major feature missing because this would greatly simplify the script marshalling build step where all JS files are concatenated and minified to one file.
Certainly, it is possible to write up a node script to parse the index.html file for the associated script resources, but this would be up to the project dev to implement, rather than being a wiredep feature.
I propose something like this:
After wiredep completes writing the script/link tags, it should output to a default/path file in a format like
The output in the array would be in the same order as wiredep outputs to the html file.
This would simplify the third-party dependency concatenation during the build process and remove any requirement by the project developer/maintainer to explicitly maintain a file with the dependencies.