Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make config path dynamic according to package.json #583

Merged
merged 1 commit into from
Sep 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions blueprints/ember-web-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ module.exports = {
};
},

fileMapTokens() {
const absPath = this.project.configPath();
// Convert to relative path as it's more useful when logged to console
const configPath = path
.dirname(absPath)
.slice(this.project.root.length + 1);

return {
__config__() {
return configPath;
},
};
},

afterInstall() {
let index = path.join('app', 'index.html');
let content = `${EOL} ${Manifest.tag}${EOL} ${Browserconfig.tag}`;
Expand Down
7 changes: 5 additions & 2 deletions lib/base-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ module.exports = class BaseManifest {
}

get configurationPath() {
return path.join(this.app.project.root, 'config', 'manifest.js');
return path.join(
path.dirname(this.app.project.configPath()),
'manifest.js'
);
}

get configuration() {
try {
let { env, project } = this.app;
let config = project.config(env);
return project.require('./config/manifest.js')(env, config);
return project.require(this.configurationPath)(env, config);
} catch (e) {
return {};
}
Expand Down