Closed fhurta closed 10 years ago
v0.8.6 released :+1:
Could somebody please provide a working example of a project with working source maps? Please include directory structure and configuration of closureDepsWriter
and closureBuilder
.
I'm trying to build app/js-closure/**/*.js
and bower-components/some-dep/**/*.js
-> dist/js/demo.min.js
and then run grunt connect
from base: "dist/"
. I've finally got everything building, but now the browser is reading app/js/...* in the source map and trying to download (from dist)
/js/app/js-closure/...*and
/js/bower-components/some-dep/...`.
I can't really comment on the js-closure
vs js
issue, that is something that shouldn't happen...
On the fact that browser tries to download from (from dist)/js....
it is a common issue and I typically just create a symlink to the folder within the dist/
folder pointing back to the sources and everything works...
I know it's not an optimal solution but hey, it works =)
I'd like to hear if anyone has solved this in any other way...
We use a grunt task (grunt-text-replace) to search-replace and fix the relative paths in the source map file:
replace: {
closure_source_map_paths: {
src: 'dist/scripts/*.js.map',
overwrite: true,
replacements: [{
// Replace paths like 'app\\shared\\bla.js' with '..\\shared\\bla.js'
from: 'app\\\\',
to: '..\\\\' // should be relative path to root from where the source map is located
}]
}
}
Thanks @sinelaw
@sinelaw :+1:
Closure Compiler v20140625 released!
https://groups.google.com/d/msg/closure-compiler-discuss/e-kTcluB40c/VDRGgP4CSZYJ
Well, it's kindly embarrassing, but I must provide fix for my previous change. (I must have done undo or something just before previous commit..)