According to the brunch documentation the property "conventions.assets" in the config file should be a regexp, but I'm trying to include the following:
conventions: {
assets: /^app\/.*\.html/
}
in order to add all the htmls into the public folder. (I know I can create an assets folder and include all the things there, but it's not possible by the moment according the structure we've agreed).
I think this property expect a directory, in this case could I fix this value in order to reach my goal?, with a function maybe?
Finally I could do that overriding the method what the property "assets" accepts.
assets: function(path) {
/**
* Loops every path and returns path|true|false according what we need
* @param path file or directory's path
* @returns path if it is a directory
* true if it fit with the regular expression
* false otherwise
*
*/
if( /\/$/.test(path) ) return path;
return /^app\/.*\.html/.test(path); // RegExp for anything we need
}
Just thought I'd comment on how my function looks like if someone have a hard time figuring out how to proceed:
assets: function(path) {
/**
* Loops every path and returns path|true|false according what we need
* @param path file or directory's path
* @returns path if it is a directory
* true if it fit with the regular expression
* false otherwise
*
*/
if( /\/$/.test(path) ) return path;
return /^(app|assets)\/.*\.(html|png|jpg|jpeg|eot|svg|ttf|woff)/.test(path);
}
This will move files, in both the app
- and assets
-folder, with the extensions: html, png, jpg, jpeg, eot, svg, ttf, woff
to the public
-folder.
I've decided to move our assets
-folder to the root-structure, so our structure looks like this now:
frontend
- app
-- common/
-- styles/
-- etc etc
- assets
-- index.html
-- css/
-- images/
-- etc etc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With