From 6714be048e270ba5315453dbe0e3709a1a98e60b Mon Sep 17 00:00:00 2001 From: Stephen Li Date: Fri, 7 Oct 2022 00:06:20 -0400 Subject: [PATCH] Disable tree shaking in dev mode --- src/webpack/QuasarUnusedPlugin.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/webpack/QuasarUnusedPlugin.ts b/src/webpack/QuasarUnusedPlugin.ts index 8473b05..0b013c4 100644 --- a/src/webpack/QuasarUnusedPlugin.ts +++ b/src/webpack/QuasarUnusedPlugin.ts @@ -56,8 +56,14 @@ export class QuasarUnusedPlugin implements WebpackPluginInstance { */ apply(compiler: Compiler) { this.#replaceQuasarMacros(compiler) - this.#findUsedComponents(compiler) this.#rewriteQuasarImport(compiler) + + // Don't run when not in production since tree-shaking is disabled anyways + if (compiler.options.mode !== 'production') { + return + } + + this.#findUsedComponents(compiler) this.#modifyQuasarModule(compiler) }