diff --git a/packages/addon-dev/src/rollup-app-reexports.ts b/packages/addon-dev/src/rollup-app-reexports.ts index 0d2fafcf5..14b4fb886 100644 --- a/packages/addon-dev/src/rollup-app-reexports.ts +++ b/packages/addon-dev/src/rollup-app-reexports.ts @@ -35,7 +35,7 @@ export default function appReexports(opts: { } // Don't cause a file i/o event unless something actually changed - if (hasChanges(pkg?.['ember-addon']?.['app-js'], appJS)) { + if (hasChanges(pkg['ember-addon']?.['app-js'], appJS)) { pkg['ember-addon'] = Object.assign({}, pkg['ember-addon'], { 'app-js': appJS, }); diff --git a/packages/addon-dev/src/rollup-public-assets.ts b/packages/addon-dev/src/rollup-public-assets.ts index 6856624d1..cbb82af8a 100644 --- a/packages/addon-dev/src/rollup-public-assets.ts +++ b/packages/addon-dev/src/rollup-public-assets.ts @@ -1,6 +1,7 @@ import { readJsonSync, writeJsonSync } from 'fs-extra'; import walkSync from 'walk-sync'; import type { Plugin } from 'rollup'; +import { hasChanges } from './utils'; export default function publicAssets( path: string, @@ -26,11 +27,13 @@ export default function publicAssets( {} ); - pkg['ember-addon'] = Object.assign({}, pkg['ember-addon'], { - 'public-assets': publicAssets, - }); + if (hasChanges(pkg['ember-addon']?.['public-assets'], publicAssets)) { + pkg['ember-addon'] = Object.assign({}, pkg['ember-addon'], { + 'public-assets': publicAssets, + }); - writeJsonSync('package.json', pkg, { spaces: 2 }); + writeJsonSync('package.json', pkg, { spaces: 2 }); + } }, }; }