Closed noway closed 11 years ago
Thare is reason for that. Mixins are "environment independant" and they does not know about config with which they are will be mixed (www paths and others). In case of sourcemap it knows fs path (sourcemap), relative www path (sourcemap_www) thats why you can not safely mix these properties with another config.
Instead of mix you can inherit one config from another - https://github.com/azproduction/lmd/tree/master/examples/features/extends
{
"extends": "./index.lmd.json",
"output": "../scripts/index.lmd.js",
"sourcemap": "../scripts/index.lmd.map",
"sourcemap_inline": true,
"sourcemap_www": ""
}
Oh, okay. I was trying do this that way, but i got error:
info: Building `dev` (.lmd/dev.lmd.js(on))
info: Writing LMD Package to /path/to/scripts/index.lmd.js
info: Writing Source Map of Package to /path/to/scripts/index.lmd.map
path.js:360
throw new TypeError('Arguments to path.join must be strings');
^
TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at Object.exports.join (path.js:358:36)
at Stream.LmdBuilder.createSourceMap (/usr/lib/node_modules/lmd/bin/lmd_builder.js:1316:30)
at Stream.LmdBuilder._build (/usr/lib/node_modules/lmd/bin/lmd_builder.js:1580:40)
at Stream.LmdBuilder.build (/usr/lib/node_modules/lmd/bin/lmd_builder.js:1692:17)
at /usr/lib/node_modules/lmd/bin/lmd_builder.js:69:40
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
After your answer I tried explicitly define www_root
and root
in dev.lmd.json
and it compiled correct. This is bug or there's reason for that behavior? Anyway, please add more informative error message here.
Thanks.
In node 0.10.x path.join become strict. Thats why this bug appears. I'll fix that, thanks!
index.lmd.json:
dev.lmd.json:
execute
$ lmd build index+dev
and project would compiled without sourcemaps.Sourcemaps starts work only if move
to
index.lmd.json