Skip to content

Commit

Permalink
feat(cli): support plugin.sideEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Jan 19, 2022
1 parent 837fa63 commit 80b3ea1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/cli/src/addons/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,11 @@ export default class FileWatcher extends Service {
for (const filename in require.cache) {
// we only detect reloads at plugin level
const module = require.cache[filename]
const state = this.ctx.app.registry.get(unwrap(module.exports))
const plugin = unwrap(module.exports)
const state = this.ctx.app.registry.get(plugin)
if (!state) continue
plugins.set(filename, state)
declined.add(filename)
if (!plugin.sideEffect) declined.add(filename)
}

for (const [filename, state] of plugins) {
Expand Down

0 comments on commit 80b3ea1

Please sign in to comment.