Use the relative path for precompiled moduleName #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While testing out ember-cli/ember-cli-htmlbars#762, I realized that we probably don't want the precompiled template
moduleName
to be an absolute path, as that would be exposing production box internals. It also doesn't match the previous behavior of older templates wheremoduleName
is relative.This change constructs the
moduleName
using thepath.relative
of the babelcwd
andfilename
options, instead of justfilename
. I tested this change out locally in an ember app. Instead of usingcwd
andfilename
withpath.relative
, we could also usestate.file.opts.sourceFileName
, which works here when I run locally, but not sure it would work universally. In theory, we could usefilenameRelative
, but anecdotally that option is not available when I build my own app locally, so it may be a new option.Without the source code change, verified tests fail: