     .pipe plugins.browserify
       debug:      if process.env.NODE_ENV == 'prod' then 'production' else 'development'
       debug:      true
+      paths: [
+          './node_modules',
+          './app/coffee/modules'
+      ],
       transform:  ['coffeeify', 'jadeify']
       extensions: ['.coffee', '.jade']
     .pipe plugins.concat(paths.bundle.dest)

    return

# Bundle server task
gulp.task 'server_bundle', ->
  gulp.src(paths.server_bundle.src)
    .pipe plugins.plumber()


# # # # #

# Build tasks
gulp.task 'default', ['dev']

gulp.task 'dev', =>
  plugins.runSequence.use(gulp)('env_dev', 'copy_fontawesome', 'copy_python', 'copy_images', 'sass', 'jade', 'concat', 'bundle', 'server_bundle', 'watch', 'webserver')

gulp.task 'release', =>
  plugins.runSequence.use(gulp)('env_prod', 'copy_fontawesome', 'copy_python', 'copy_images', 'sass', 'jade', 'concat', 'bundle', 'server_bundle', => console.log 'Release completed.' )

gulp.task 'nwk_dev', =>
  plugins.runSequence.use(gulp)('env_dev', 'copy_fontawesome', 'copy_python', 'copy_images', 'sass', 'jade', 'concat', 'bundle', 'server_bundle', 'nodewebkit_package', 'watch', 'nodewebkit_watch')

gulp.task 'nwk_release', =>
  plugins.runSequence.use(gulp)('env_dev', 'copy_fontawesome', 'copy_python', 'copy_images', 'sass', 'jade', 'concat', 'bundle', 'server_bundle', 'nodewebkit_package', 'nodewebkit_release', => console.log 'NWK Release completed.' )
