2014-01-03 13:32:13 -05:00
|
|
|
sysPath = require 'path'
|
|
|
|
startsWith = (string, substring) ->
|
|
|
|
string.lastIndexOf(substring, 0) is 0
|
|
|
|
|
|
|
|
exports.config =
|
|
|
|
paths:
|
|
|
|
'public': 'public'
|
|
|
|
conventions:
|
|
|
|
ignored: (path) -> startsWith(sysPath.basename(path), '_')
|
2014-06-24 16:41:24 -04:00
|
|
|
sourceMaps: false
|
2014-01-03 13:32:13 -05:00
|
|
|
files:
|
|
|
|
javascripts:
|
|
|
|
defaultExtension: 'coffee'
|
|
|
|
joinTo:
|
2014-02-14 19:52:50 -05:00
|
|
|
'javascripts/world.js': ///^(
|
|
|
|
(app[\/\\]lib[\/\\]world(?![\/\\]test))
|
|
|
|
|(app[\/\\]lib[\/\\]CocoClass.coffee)
|
|
|
|
|(app[\/\\]lib[\/\\]utils.coffee)
|
|
|
|
|(vendor[\/\\]scripts[\/\\]Box2dWeb-2.1.a.3)
|
|
|
|
|(vendor[\/\\]scripts[\/\\]string_score.js)
|
|
|
|
)///
|
2014-01-03 13:32:13 -05:00
|
|
|
'javascripts/app.js': /^app/
|
2014-02-14 19:52:50 -05:00
|
|
|
'javascripts/vendor.js': ///^(
|
2014-02-17 20:38:49 -05:00
|
|
|
vendor[\/\\](?!scripts[\/\\]Box2d)
|
2014-05-09 18:22:23 -04:00
|
|
|
|bower_components[\/\\](?!aether)
|
2014-02-14 19:52:50 -05:00
|
|
|
)///
|
|
|
|
'javascripts/vendor_with_box2d.js': ///^(
|
2014-02-17 20:38:49 -05:00
|
|
|
vendor[\/\\]
|
2014-05-09 18:22:23 -04:00
|
|
|
|bower_components[\/\\](?!aether) # include box2dweb for profiling (and for IE9...)
|
2014-02-14 19:52:50 -05:00
|
|
|
)///
|
2014-05-09 18:22:23 -04:00
|
|
|
'javascripts/lodash.js': ///^(
|
2014-02-18 13:03:57 -05:00
|
|
|
(bower_components[\/\\]lodash[\/\\]dist[\/\\]lodash.js)
|
|
|
|
)///
|
2014-05-09 18:22:23 -04:00
|
|
|
'javascripts/aether.js': ///^(
|
|
|
|
(bower_components[\/\\]aether[\/\\]build[\/\\]aether.js)
|
|
|
|
)///
|
2014-06-05 19:55:49 -04:00
|
|
|
'javascripts/test-app.js': /^test[\/\\]app/
|
2014-06-14 18:02:14 -04:00
|
|
|
'javascripts/demo-app.js': /^test[\/\\]demo/
|
2014-06-14 10:37:31 -04:00
|
|
|
|
2014-01-03 13:32:13 -05:00
|
|
|
order:
|
|
|
|
before: [
|
2014-04-11 13:12:39 -04:00
|
|
|
'bower_components/jquery/dist/jquery.js'
|
2014-01-03 13:32:13 -05:00
|
|
|
'bower_components/lodash/dist/lodash.js'
|
|
|
|
'bower_components/backbone/backbone.js'
|
|
|
|
# Twitter Bootstrap jquery plugins
|
2014-04-05 20:05:03 -04:00
|
|
|
'bower_components/bootstrap/dist/bootstrap.js'
|
2014-01-03 13:32:13 -05:00
|
|
|
# CreateJS dependencies
|
|
|
|
'vendor/scripts/easeljs-NEXT.combined.js'
|
|
|
|
'vendor/scripts/preloadjs-NEXT.combined.js'
|
|
|
|
'vendor/scripts/soundjs-NEXT.combined.js'
|
|
|
|
'vendor/scripts/tweenjs-NEXT.combined.js'
|
|
|
|
'vendor/scripts/movieclip-NEXT.min.js'
|
2014-04-11 14:05:48 -04:00
|
|
|
# Validated Backbone Mediator dependencies
|
|
|
|
'bower_components/tv4/tv4.js'
|
2014-01-03 13:32:13 -05:00
|
|
|
# Aether before box2d for some strange Object.defineProperty thing
|
|
|
|
'bower_components/aether/build/aether.js'
|
2014-04-02 21:41:10 -04:00
|
|
|
'bower_components/d3/d3.min.js'
|
2014-04-22 11:54:35 -04:00
|
|
|
'vendor/scripts/async.js'
|
2014-01-03 13:32:13 -05:00
|
|
|
]
|
|
|
|
stylesheets:
|
|
|
|
defaultExtension: 'sass'
|
|
|
|
joinTo:
|
2014-04-07 17:34:36 -04:00
|
|
|
'stylesheets/app.css': /^(app|vendor|bower_components)/
|
2014-01-03 13:32:13 -05:00
|
|
|
order:
|
2014-04-02 17:40:06 -04:00
|
|
|
before: [
|
|
|
|
'app/styles/bootstrap.scss'
|
2014-04-03 14:43:09 -04:00
|
|
|
'vendor/styles/nanoscroller.scss'
|
2014-04-02 17:40:06 -04:00
|
|
|
]
|
2014-01-03 13:32:13 -05:00
|
|
|
templates:
|
|
|
|
defaultExtension: 'jade'
|
|
|
|
joinTo: 'javascripts/app.js'
|
|
|
|
framework: 'backbone'
|
|
|
|
|
|
|
|
plugins:
|
2014-06-07 19:30:01 -04:00
|
|
|
autoReload:
|
2014-06-10 17:34:16 -04:00
|
|
|
delay: 300
|
2014-01-03 13:32:13 -05:00
|
|
|
coffeelint:
|
|
|
|
pattern: /^app\/.*\.coffee$/
|
|
|
|
options:
|
|
|
|
line_endings:
|
|
|
|
value: "unix"
|
|
|
|
level: "error"
|
|
|
|
max_line_length:
|
|
|
|
level: "ignore"
|
|
|
|
no_trailing_whitespace:
|
|
|
|
level: "ignore" # PyCharm can't just autostrip for .coffee, needed for .jade
|
|
|
|
no_unnecessary_fat_arrows:
|
|
|
|
level: "ignore"
|
|
|
|
uglify:
|
|
|
|
output:
|
2014-01-03 16:49:36 -05:00
|
|
|
semicolons: false
|
2014-06-07 19:30:01 -04:00
|
|
|
|
|
|
|
onCompile: (files) ->
|
|
|
|
exec = require('child_process').exec
|
|
|
|
regexFrom = '\\/\\/# sourceMappingURL=([^\\/].*)\\.map'
|
|
|
|
regexTo = '\\/\\/# sourceMappingURL=\\/javascripts\\/$1\\.map'
|
|
|
|
regex = "s/#{regexFrom}/#{regexTo}/g"
|
|
|
|
for file in files
|
|
|
|
c = "perl -pi -e '#{regex}' #{file.path}"
|
|
|
|
exec c
|