Multiple base paths and precompile don't play well together
Issue #9
new
Parable has a base
option that is used to generate a relative filename for Babel. If you have a directory structure like this:
- core - foo - bar - baz.js
- plugin - beep - boop - blah.js
You can only specify a single parable.base
for the whole pre-compile. If you specify core
as the base, then the relative filename of plugin/beep/boop/blah.js
will be ../plugin/beep/boop/blah.js
, but if you are using Babel to generate named AMD modules you probably want it to be beep/boop/blah.js
.
There might be a couple of ways of solving the problem, this is a rough quick and probably non-exhaustive list:
- create a
.parablerc
config. When transforming a file, walk up the directory tree to the closest.parablerc
to find the base. This might get expensive. - add parable options to
.babelrc
and search for that. Same cons as above. - optionally allow
base
to be abases
array of paths - the closest matching one for the current file will be used