Skip to content

Commit

Permalink
fix(build): watcher of webpack watches too many files include output …
Browse files Browse the repository at this point in the history
…files

closes #3672
  • Loading branch information
UncleBill committed Jul 14, 2021
1 parent 8fa0784 commit ba21ffd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/maskbook/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ function EnvironmentPluginNoCache(def: Record<string, any>) {
}
return new DefinePlugin(next)
}
const watchOptions = {
ignored: /\bnode_modules\b/,
}

function config(opts: {
name: string
Expand Down Expand Up @@ -232,6 +235,7 @@ function config(opts: {
'Access-Control-Allow-Origin': '*',
},
transportMode: 'ws',
watchOptions,
} as DevServerConfiguration,
}
if (isProfile) {
Expand Down Expand Up @@ -323,7 +327,7 @@ export default async function (cli_env: Record<string, boolean> = {}, argv: { mo
// @ts-ignore
delete injectedScript.devServer
// TODO: multiple config seems doesn't work well therefore we start the watch mode webpack compiler manually, ignore the build message currently
webpack(injectedScript, () => {}).watch({}, () => {})
webpack(injectedScript).watch(watchOptions, () => {})
return main

function withReactDevTools(...x: string[]) {
Expand Down

0 comments on commit ba21ffd

Please sign in to comment.