embroider-build / ember-auto-import

Zero config import from npm packages
Other
361 stars 110 forks source link

Embroider app doesn't detect runtime changes of v2 addon #590

Closed gnembisz closed 7 months ago

gnembisz commented 10 months ago

I created a monorepo with v2 addon and 2 apps (ember classic 5.1 and embroder app 5.1). I run addon with:

rollup --config --watch

Both apps in ember-cli-build.js has watchDependencies configured:

    autoImport: {
      watchDependencies: ['addon_name'],
    },

The classic app detects runtime changes in addon and is rebuilding, the embroider app doesn't.

I also found that test-app generated by v2 addon bleuprint is using function maybeEmbroider():

module.exports = function (defaults) {
  let app = new EmberApp(defaults, {
    autoImport: {
      watchDependencies: ['addon_name'],
    },
  });

  const { maybeEmbroider } = require('@embroider/test-setup');
  return maybeEmbroider(app);
};

and by default watching for changes in runtime works there, because by default this method is using classic build. Forcing embroider the by adding @embroider/core (etc.) dependencies also stops runtime detection of changes in addon.

simonihmig commented 7 months ago

ember-auto-import is basically a no-op under Embroider AFAIK. So the issue you are describing is better raised at https://github.com/embroider-build/embroider/issues. @gnembisz I am closing this, but if you are still observing this, could you please file the issue over there?