Using Bower with Play

Here's what my file structure looks like on Play:

- public - bower_components - images - stylesheets 

This is my <head> :

 <head> <title>@title</title> <link rel="shortcut icon" href='@routes.Assets.at("images/favicon.png")'> <link rel="stylesheet" media="screen" href='@routes.Assets.at("bower_components/bootstrap/dist/css/bootstrap.min.css")'> <link rel="stylesheet" media="screen" href='@routes.Assets.at("stylesheets/main.css")'> <script src='@routes.Assets.at("bower_components/jquery/dist/jquery.min.js")'></script> <script src='@routes.Assets.at("bower_components/bootstrap/dist/js/bootstrap.min.js")'></script> </head> 

Routes:

 GET / controllers.Application.index GET /public controllers.Application.public GET /assets/*file controllers.Assets.at(path="/public", file) 

He is working on development. I get the 200s. When I deploy to Heroku, I get 404s for all bower components, with the exception of style lists and images.

I suppose this could be because Play cannot recognize the bower component catalog. Does anyone know how to add a new directory for a game to create from assets?

+7
scala bower playframework heroku
source share
1 answer

When using the gazebo with the game, remember that the assets that you will use are stored in the /dist folder. Now you may not think that this is a big deal, but if you check the default .gitignore , you will find that it has the following four characters in one line:

 dist 

This is enough to ignore all dist in your application. Just delete the line, run the git status, and you will find that you have new files to add to your repo.

Lock and click on Heroka. You should be good to go.

+4
source share

All Articles