mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-03-06 22:01:17 +00:00
add assets task that copies everything from src/assets/ to public/
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,5 +1,3 @@
|
||||
node_modules
|
||||
public/*.html
|
||||
public/css/*.css
|
||||
public/js/*.js
|
||||
public
|
||||
vendor
|
||||
|
||||
@@ -23,5 +23,9 @@
|
||||
* npm run build
|
||||
* Builds & minifies everything
|
||||
|
||||
## Development guidelines
|
||||
* **public** - directory should be dedicated only to compiled/copied files from **src** - directory.
|
||||
It should be possible to delete directory completely and after **npm start** or **npm run build** everything should be as they were before the deletation.
|
||||
|
||||
## Enable LiveReload
|
||||
Install [LiveReload for Chrome](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei?hl=en)
|
||||
|
||||
@@ -14,7 +14,6 @@ livereload = require 'gulp-livereload'
|
||||
reloadServer = lr()
|
||||
|
||||
compileCoffee = (debug = false) ->
|
||||
|
||||
config =
|
||||
debug: debug
|
||||
transform: ['coffeeify']
|
||||
@@ -51,15 +50,22 @@ compileStylus = (debug = false) ->
|
||||
styles.pipe(gulp.dest('public/css/'))
|
||||
.pipe livereload reloadServer
|
||||
|
||||
copyAssets = (debug = false) ->
|
||||
gulp
|
||||
.src('src/assets/**/*.*')
|
||||
.pipe gulp.dest 'public/'
|
||||
|
||||
# Build tasks
|
||||
gulp.task "jade-production", -> compileJade()
|
||||
gulp.task 'stylus-production', ->compileStylus()
|
||||
gulp.task 'coffee-production', -> compileCoffee()
|
||||
gulp.task 'assets-production', -> copyAssets()
|
||||
|
||||
# Development tasks
|
||||
gulp.task "jade", -> compileJade(true)
|
||||
gulp.task 'stylus', -> compileStylus(true)
|
||||
gulp.task 'coffee', -> compileCoffee(true)
|
||||
gulp.task 'assets', -> copyAssets(true)
|
||||
|
||||
gulp.task "server", ->
|
||||
staticFiles = new nodeStatic.Server './public'
|
||||
@@ -76,9 +82,10 @@ gulp.task "watch", ->
|
||||
gulp.watch "src/coffee/*.coffee", ["coffee"]
|
||||
gulp.watch "src/jade/*.jade", ["jade"]
|
||||
gulp.watch "src/stylus/*.styl", ["stylus"]
|
||||
gulp.watch "src/assets/**/*.*", ["assets"]
|
||||
|
||||
gulp.task "build", ->
|
||||
gulp.run "coffee-production", "jade-production", "stylus-production"
|
||||
gulp.run "coffee-production", "jade-production", "stylus-production", "assets-production"
|
||||
|
||||
gulp.task "default", ->
|
||||
gulp.run "coffee", "jade", "stylus", "watch", "server"
|
||||
gulp.run "coffee", "jade", "stylus", "assets", "watch", "server"
|
||||
|
||||
Reference in New Issue
Block a user