Skip to content

Commit

Permalink
Public assets needed the same condition
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed May 12, 2023
1 parent 635f816 commit 71416c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/addon-dev/src/rollup-app-reexports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
11 changes: 7 additions & 4 deletions packages/addon-dev/src/rollup-public-assets.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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 });
}
},
};
}

0 comments on commit 71416c7

Please sign in to comment.