Skip to content

Commit

Permalink
Ensure custom templateCompilerPath is an absolute path.
Browse files Browse the repository at this point in the history
The examples that we show for using a custom template compiler path use
a relative path, but that doesn't actually work when inline compilation
runs and is parallelized (because the worker processes run from a
different relative root inside `/tmp`).

This ensures that any specified overrides are converted to absolute
paths.
  • Loading branch information
rwjblue committed May 8, 2020
1 parent 0d362f4 commit 730fb93
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ember-addon-main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

const path = require('path');
const SilentError = require('silent-error');
const utils = require('./utils');

Expand Down Expand Up @@ -201,6 +202,10 @@ module.exports = {
app.options['ember-cli-htmlbars'].templateCompilerPath;

if (templateCompilerPath) {
if (!path.isAbsolute(templateCompilerPath)) {
templateCompilerPath = path.resolve(this.project.root, templateCompilerPath);
}

return templateCompilerPath;
}

Expand Down

0 comments on commit 730fb93

Please sign in to comment.