From 91f3fb04f3b3acef2cb041e80fdfaf20ad4f73ad Mon Sep 17 00:00:00 2001 From: hemengke <23536175@qq.com> Date: Fri, 1 Dec 2023 16:00:51 +0800 Subject: [PATCH] perf: enable sourcemap in dev --- src/node/build/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/build/index.ts b/src/node/build/index.ts index 58f8580..852ce26 100644 --- a/src/node/build/index.ts +++ b/src/node/build/index.ts @@ -2,6 +2,7 @@ import createDebug from 'debug' import { type BuildResult, type Plugin } from 'esbuild' import path from 'node:path' import colors from 'picocolors' +import { isDevelopment } from 'std-env' import { globalConfig } from '../global-config' import { type GlobalConfig } from '../global-config/GlobalConfigBuilder' import { getContentHash, isBoolean, isInTest, pkgName } from '../helper/utils' @@ -92,7 +93,7 @@ export async function esbuildTypescript(buildOptions: IBuildOptions) { format: 'iife', logLevel: 'silent', minify: !!viteConfig.build.minify, - sourcemap: false, + sourcemap: isDevelopment ? 'inline' : false, splitting: false, treeShaking: true, write: false,