誰かが続行方法を理解するのに苦労している場合、私の関数がどのように見えるかについてコメントしたいと思いました:
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);
}
これにより、app
- と -assets
フォルダーの両方にあるファイルが拡張子: でhtml, png, jpg, jpeg, eot, svg, ttf, woff
-フォルダーに移動されますpublic
。
フォルダーをルート構造に移動することにしassets
たので、構造は次のようになります。
frontend
- app
-- common/
-- styles/
-- etc etc
- assets
-- index.html
-- css/
-- images/
-- etc etc