https://github.com/ember-cli/ember-cli-add-template-compiler-to-package
Utility to add a template compiler to your package.json
https://github.com/ember-cli/ember-cli-add-template-compiler-to-package
Last synced: 7 months ago
JSON representation
Utility to add a template compiler to your package.json
- Host: GitHub
- URL: https://github.com/ember-cli/ember-cli-add-template-compiler-to-package
- Owner: ember-cli
- Created: 2016-05-16T03:22:23.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-11-07T13:32:34.000Z (about 7 years ago)
- Last Synced: 2025-06-05T00:20:03.344Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 12
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ember-cli-add-template-compiler-to-package
This is a utility to add a template compiler (ember-cli-htmlbars) to your addon's package.json. It is intended to be used inside ember-cli blueprints.
# Usage
This utility returns a promise and is meant to be used inside the afterInstall hook of a blueprint. The function expects the path to your project's root, and the name of the template compiler to add to your package.json. The primary usage for this is
```js
// A blueprint
var path = require('path');
var addPackageTemplateCompiler = require('ember-cli-add-template-compiler-to-package');
module.exports = {
afterInstall: function(options) {
if (options.project.isEmberCLIAddon() || options.inRepoAddon) {
var projectRoot = options.inRepoAddon ? path.join(this.project.root, 'lib', options.inRepoAddon) : this.project.root;
return addPackageTemplateCompiler(projectRoot);
}
}
}
```