Skip to content

Commit

Permalink
Better defaults for publicEntrypoints and appReexports
Browse files Browse the repository at this point in the history
  • Loading branch information
simonihmig committed Sep 26, 2023
1 parent 3ff3e52 commit 18253e3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions files/__addonLocation__/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,22 @@ export default {
plugins: [
// These are the modules that users should be able to import from your
// addon. Anything not listed here may get optimized away.
addon.publicEntrypoints(['components/**/*.js', 'index.js'<% if (typescript) {%>, 'template-registry.js'<% } %>]),
// By default all your JavaScript modules (**/*.js) will be importable.
// But you are encouraged to tweak this to only cover the modules that make
// up your addon's public API. Also make sure your package.json#exports
// is aligned to the config here.
// See https://github.com/embroider-build/embroider/blob/main/docs/v2-faq.md#how-can-i-define-the-public-exports-of-my-addon
addon.publicEntrypoints(['**/*.js', 'index.js'<% if (typescript) {%>, 'template-registry.js'<% } %>]),

// These are the modules that should get reexported into the traditional
// "app" tree. Things in here should also be in publicEntrypoints above, but
// not everything in publicEntrypoints necessarily needs to go here.
addon.appReexports(['components/**/*.js']),
addon.appReexports([
'components/**/*.js',
'helpers/**/*.js',
'modifiers/**/*.js',
'services/**/*.js',
]),

// Follow the V2 Addon rules about dependencies. Your code can import from
// `dependencies` and `peerDependencies` as well as standard Ember-provided
Expand Down

0 comments on commit 18253e3

Please sign in to comment.