-
Notifications
You must be signed in to change notification settings - Fork 0
Ember Addons
Kyle Coberly edited this page Jul 8, 2017
·
1 revision
- To create an addon:
ember addon <name>
-
/addon- “private area”, own namespace -
/app- will get merged -
/tests/dummy- dummy application to test your component
-
Brocfile.js- only gets used by the dummy application -
index.js- Entry point for the addon
-
includedhook runs duringember build - Can
app.importthird-party dependencies and assets -
isDevelopingAddon: true← enablesliveReload
-
package.json-
ember-addonhash includes:configPath-
before/afterhooks for other addons -
demoURLfor fully qualified demo site URL
-
-
blueprints/<name>/index.js- Runs after installation
- Can use
contentForto add a content helper
- Need to fill out
package.json - Need a property in
package.jsonwith"package-name": "npm-version" -
npm linkin addon to locally publish,npm install ../<path>to locally install- Have to manually run blueprint with
ember g <blueprint-name>
- Have to manually run blueprint with
-
npm publishto publically publish
- Import/export your addon in the app folder to make it available
- Templates go in the app area
- Don’t use stylesheets for addons, or give them their own addons
- You can include dependencies like normal in an addon
- Don’t use prototype extensions in an addon
- You can
.npmignoretests and dependencies -
LiveReloadis disabled by default. Enable inindex.js - Addons can install bower packages
- A linked local addon can livereload in your app