Hack to fix source map URLs in production brunch.
This commit is contained in:
parent
d007f5337e
commit
1cada9dd77
1 changed files with 28 additions and 20 deletions
|
@ -31,6 +31,15 @@ exports.config =
|
|||
overrides:
|
||||
production:
|
||||
sourceMaps: 'absoluteUrl'
|
||||
onCompile: (files) ->
|
||||
# For some reason, production brunch produces two entries, the first of which is wrong:
|
||||
# //# sourceMappingURL=public/javascripts/app.js.map
|
||||
# //# sourceMappingURL=/javascripts/app.js.map
|
||||
# So we remove the ones that have public in them.
|
||||
exec = require('child_process').exec
|
||||
for file in files
|
||||
exec "perl -pi -e 's/\\/\\/# sourceMappingURL=public.*//g' #{file.path}"
|
||||
exec c
|
||||
|
||||
files:
|
||||
javascripts:
|
||||
|
@ -172,7 +181,6 @@ exports.config =
|
|||
defn = if path in needHeaders then commonjsHeader else ''
|
||||
return defn
|
||||
|
||||
|
||||
#- Find all .coffee and .jade files in /app
|
||||
|
||||
dirStack = ['./app']
|
||||
|
|
Reference in a new issue