mirror of
https://github.com/hanzoai/ecommerce-boilerplate.git
synced 2026-10-30 18:38:20 +00:00
65 lines
1.4 KiB
Plaintext
65 lines
1.4 KiB
Plaintext
use 'sake-bundle'
|
|
use 'sake-linked'
|
|
use 'sake-outdated'
|
|
use 'sake-test'
|
|
use 'sake-version'
|
|
|
|
use 'sake-publish',
|
|
deploy:
|
|
remote: 'origin'
|
|
refspec: 'master:master'
|
|
npm: false
|
|
|
|
task 'build', 'build project', ['build:static', 'build:js']
|
|
|
|
task 'build-min', 'build minified project', ['build:static', 'build-min:js']
|
|
|
|
task 'build:js', 'build js', ->
|
|
return if (running 'build')
|
|
|
|
bundle.write
|
|
entry: 'src/js/app.coffee'
|
|
output: 'public/js/app.js'
|
|
cache: false
|
|
format: 'web'
|
|
commonjs: true
|
|
external: false
|
|
compilers:
|
|
coffee:
|
|
version: 1
|
|
.catch (err) ->
|
|
console.error err
|
|
|
|
task 'build-min:js', 'build minified js', ['build'], ->
|
|
exec '''
|
|
uglifyjs public/js/app.js -o public/js/app.min.js
|
|
cp public/js/app.min.js public/js/app.js
|
|
'''
|
|
|
|
task 'build:static', 'build static assets', ->
|
|
exec '''
|
|
mkdir -p public/css
|
|
mkdir -p public/js
|
|
bebop compile'
|
|
'''
|
|
|
|
task 'watch', 'watch for changes and rebuild project', ['build:js', 'watch:js', 'watch:static']
|
|
|
|
task 'watch:js', 'watch js for changes and rebuild', ->
|
|
build = (filename) ->
|
|
return if (running 'build')
|
|
console.log filename, 'modified'
|
|
invoke 'build:js'
|
|
|
|
watch 'src/*', build
|
|
watch 'node_modules/*', build
|
|
|
|
task 'watch:static', 'watch static files and rebuild', ['build:static'], ->
|
|
exec 'bebop'
|
|
|
|
task 'start', 'start server', ['build'], ->
|
|
exec '''
|
|
coffee ./server.coffee
|
|
'''
|
|
|