From 98f360aacfc0b5e502594811ea5de725206aa050 Mon Sep 17 00:00:00 2001 From: Terence Honles Date: Thu, 20 Apr 2023 08:22:37 -0700 Subject: [PATCH] feat(cli): inline CSS sourcemaps in addition to JS sourcemaps This change updates the cli copy's `--inline` handling to also inline the CSS sourcemaps and not just the JS sourcemaps. --- cli/src/tasks/sourcemaps.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/src/tasks/sourcemaps.ts b/cli/src/tasks/sourcemaps.ts index 54b79fe5d7..578aa39c77 100644 --- a/cli/src/tasks/sourcemaps.ts +++ b/cli/src/tasks/sourcemaps.ts @@ -19,7 +19,10 @@ function walkDirectory(dirPath: string) { walkDirectory(targetFile); } else { const mapFile = join(dirPath, `${file}.map`); - if (extname(file) === '.js' && existsSync(mapFile)) { + if ( + (extname(file) === '.js' || extname(file) === '.css') && + existsSync(mapFile) + ) { const bufMap = readFileSync(mapFile).toString('base64'); const bufFile = readFileSync(targetFile, 'utf8'); const result = bufFile.replace(