Skip to content

Commit

Permalink
feat(cli): inline CSS sourcemaps in addition to JS sourcemaps
Browse files Browse the repository at this point in the history
This change updates the cli copy's `--inline` handling to also inline
the CSS sourcemaps and not just the JS sourcemaps.
  • Loading branch information
terencehonles committed Apr 21, 2023
1 parent 49e8307 commit 38e12e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/src/tasks/sourcemaps.ts
Expand Up @@ -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(
Expand Down

0 comments on commit 38e12e2

Please sign in to comment.