Skip to content

Commit

Permalink
[ember-cli-eyeglass] Use the addon's parentPath for the annotation an…
Browse files Browse the repository at this point in the history
…d caching, it's more correctly unique.
  • Loading branch information
chriseppstein committed Mar 23, 2019
1 parent 1a31286 commit 3c300cf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/ember-cli-eyeglass/src/index.ts
Expand Up @@ -197,22 +197,19 @@ const EMBER_CLI_EYEGLASS = {
},

setupConfig(config: ConstructorParameters<typeof EyeglassCompiler>[1], options) {
let {isApp, app, name} = EYEGLASS_INFO_PER_ADDON.get(this);
let {isApp, app, parentPath} = EYEGLASS_INFO_PER_ADDON.get(this);
let {sessionCache} = EYEGLASS_INFO_PER_APP.get(app);
config.sessionCache = sessionCache;
config.annotation = `EyeglassCompiler(${name})`;
config.annotation = `EyeglassCompiler(${parentPath})`;
if (!config.sourceFiles && !config.discover) {
config.sourceFiles = [isApp ? 'app.scss' : 'addon.scss'];
}
config.assets = ['public', 'app'].concat(config.assets || []);
config.eyeglass = config.eyeglass || {}
config.eyeglass.httpRoot = config.eyeglass.httpRoot || config["httpRoot"];
if (config.persistentCache) {
config.persistentCache += `-${name}`
if (isApp) {
// If we don't scope this a cache reset of the app deletes the addon caches
config.persistentCache += "/app";
}
let cacheDir = parentPath.replace(/\//g, "$");
config.persistentCache += `/${cacheDir}`;
}

config.assetsHttpPrefix = config.assetsHttpPrefix || getDefaultAssetHttpPrefix(this.parent);
Expand Down

0 comments on commit 3c300cf

Please sign in to comment.