Support arbitrary static files in Lineman with the grunt-contrib-copy task
grunt-contrib-copy
taskWith this configuration, any file or directory (recursively) in static/
will be copied over as a static asset. (directory structure is preserved.) For example, given:
static/
favicon.ico
js/
html5shim.js
Then lineman build
(with latest lineman, and default setup) will create:
dist/
css/
app.css
favicon.ico
index.html
js/
app.js
html5shim.js
Warning: If there are any name conflicts between files in 'static' and the normal lineman build assets, the static files will overwrite the others (since the copy task is run last).
"dependencies": {
"grunt-contrib-copy": "~0.4.1"
}
module.exports = require(process.env['LINEMAN_MAIN']).config.extend "application",
# tell lineman to load the grunt-contrib-copy task via npm
loadNpmTasks: 'grunt-contrib-copy'
# tell lineman to run the copy tasks as part of its build process
# run 'dev' target for both run and build phases
# run 'dist' target during build phase
appendTasks:
common: "copy:dev"
dist: "copy:dist"
# configure the copy task
copy:
dev:
files: [ expand: true, cwd: 'static', src: '**', dest: 'generated' ]
dist:
files: [ expand: true, cwd: 'static', src: '**', dest: 'dist' ]