Open bitliner opened 10 years ago
Does anybody has the same problem?
I found my problem. Specifically:
app.use(assets,{})
)start all with the prefix static/
(the folder 'static/' is in the root of the project; I did it for the integration with tools of minification, like grunt-uglify) cachify('<path>')
starts without the prefix static/
, because the server serves static files directly from the static folder static/
(so if the file in assets field is specified like 'static/file1.js', the path in the views the server serves is '/file1.js' )prod_or_dev_tags
was failing in creating the right tags for the asset filesI solved adding in the options object a field myprefix
. In this way the method prod_or_dev_tags
can always understand how to serve properly asset files.
I didn't use the option url_to_paths
because I had to specify too much stuff.
If it's worth to be integrated with the master repository let me know.
My conf is like this:
var cachify = require('connect-cachify') app.use(cachify.setup( getAllWithPublicAsRoot() , { root: path.join(__dirname, 'public'), production: false }));
where getAllWithPublicAsRoot returns an object like:{ "/js/files.min.js":['/js/file1.js', '/js/file2.js'] }
where js folder is in public folder.But if I see the html code in the page, it puts in the html
/js/files.min.js
, not the corresponding files specified in the corresponding array.I'm using connect-cachify 0.0.15