所以简单的解决方案是最好的。使用符号链接将文件放在正确的位置。
另一种选择是运行
container_commands
从
bower
包工作。在下面的代码段中,您可以替换单词
app
应用程序的目录/名称。我已经说过了
弓箭手
将程序包安装到
app/static/libs
.
container_commands:
04_project_bower_install:
command: 'bower --allow-root install'
leader-only: 'false'
05_move_fonts:
command: 'mkdir -p app/static/fonts;
export DIRS=`find app/static/libs -name fonts -type d -print `;
export FILES=`find $DIRS \( -name \*.ttf -o -name \*.woff -o -name \*.woff2 -o -name \*.eot -o -name \*.svg \) -print`;
echo "copying fonts $FILES";
cp -fu $FILES app/static/fonts'
leader-only: 'false'
06_move_images:
command: 'mkdir -p app/static/images;
export DIRS=`find app/static/libs -name images -type d -print `;
export FILES=`find $DIRS \( -name "*.jpg" -or -name "*.png" -or -name "*.gif" -or -name "*.svg" \) -print -maxdepth 1 -type f`;
echo "copying image $FILES";
cp -fu $FILES app/static/images'
leader-only: 'false'
可以说,写一个小的
asset_setup.sh
并运行该命令,而不是在
.ebextensions
配置文件。