Adding Static Files to a Lineman Build

Adding Static Files to a Lineman Build using Grunt and Htaccess. You can add static files files such as favicon.ico to the /app/static/ folder and it will be copied over for dev and dist. But when you add a .htaccess file it doesn’t get copied across. It looks like DOT files are by default excluded from the GLOB search of files. We could add this option to the lineman core but to run it as a separate in our application.

A working solution.

To add it as an entirely new task add this code to /config/application.js. I believe this is recursive (expand option) so we can have a folder say js and it would copy the files to the js folder in our dist directory.

So to have apache server out our HTML5 push state we can include the following in our .htaccess file:

There is also a slightly different version you can use:

Sam Deering is a web developer from England (currently living in Australia). In his spare time he enjoys coding, playing chess, reading and investing.

Leave a Reply

Your email address will not be published. Required fields are marked *