fix: Remove HMR log

It was causing too many logs during development.
This commit is contained in:
Aaron Klinker
2023-07-15 14:10:50 -05:00
parent 992452cdae
commit 90fa6bfc40
3 changed files with 0 additions and 27 deletions
-1
View File
@@ -122,7 +122,6 @@ export async function getInternalConfig(
);
finalConfig.vite.plugins.push(plugins.devServerGlobals(finalConfig));
finalConfig.vite.plugins.push(plugins.tsconfigPaths(finalConfig));
finalConfig.vite.plugins.push(plugins.hmrLogger(finalConfig));
finalConfig.vite.define ??= {};
getGlobals(finalConfig).forEach((global) => {
-25
View File
@@ -1,25 +0,0 @@
import { Plugin } from 'vite';
import { InternalConfig } from '../types';
import { relative } from 'path';
import pc from 'picocolors';
/**
* Log when HMR changes are fired
*/
export function hmrLogger(config: InternalConfig): Plugin {
return {
name: 'wxt:hmr-logger',
apply: 'serve',
handleHotUpdate(ctx) {
if (
ctx.file.startsWith(config.srcDir) &&
!ctx.file.startsWith(config.wxtDir) &&
!ctx.file.endsWith('.html')
) {
config.logger.info(
'Hot reload: ' + pc.dim(relative(process.cwd(), ctx.file)),
);
}
},
};
}
-1
View File
@@ -5,4 +5,3 @@ export * from './multipageMove';
export * from './unimport';
export * from './virtualEntrypoint';
export * from './tsconfigPaths';
export * from './hmrLogger';