After installing this into my ember app I get the following error when running ember asset-sizes:
Cannot find module '/Users/tom/<monorepo-root>/packages/<ember-app>/node_modules/ember-cli/lib/broccoli/ember-app'
Stack Trace and Error Report: /var/folders/_6/dgtlmj695fv5yds8f5hwvcbs8snz_f/T/error.dump.e5067a82d42b320f08aa37979af1831a.log
An error occurred in the constructor for ember-cli-asset-sizes-shim at /Users/tom/<monorepo-root>/node_modules/ember-cli-asset-sizes-shim
Note that my app is in a monorepo using yarn workspaces, so I have to use yarn add ember-cli-asset-sizes-shim and then ember generate ember-cli-asset-sizes-shim to install the addon, and that also returns the above error.
After installing this into my ember app I get the following error when running
ember asset-sizes
:Note that my app is in a monorepo using yarn workspaces, so I have to use
yarn add ember-cli-asset-sizes-shim
and thenember generate ember-cli-asset-sizes-shim
to install the addon, and that also returns the above error.It looks like the error comes from these hardcoded paths: https://github.com/isleofcode/ember-cli-asset-sizes-shim/blob/1c7d8035e9d5d38ee5bd45fdfbdc0402c7ceb8fc/index.js#L81-L82
Those would probably need to use
require.resolve()
in order to work in a monorepo.