Skip to content

Commit 10211f4

Browse files
authored
fix(nextjs): Delete css map files (#18131)
closes #18125 We want to delete `*.map.css` files when `deleteSourcemapsAfterUpload` is enabled.
1 parent d26e1a9 commit 10211f4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/nextjs/src/config/getBuildPluginOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const FILE_PATTERNS = {
4040
} as const;
4141

4242
// Source map file extensions to delete
43-
const SOURCEMAP_EXTENSIONS = ['*.js.map', '*.mjs.map', '*.cjs.map'] as const;
43+
const SOURCEMAP_EXTENSIONS = ['*.js.map', '*.mjs.map', '*.cjs.map', '*.css.map'] as const;
4444

4545
type BuildTool = keyof typeof LOGGER_PREFIXES;
4646

packages/nextjs/test/config/getBuildPluginOptions.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ describe('getBuildPluginOptions', () => {
308308
'/path/to/.next/static/**/*.js.map',
309309
'/path/to/.next/static/**/*.mjs.map',
310310
'/path/to/.next/static/**/*.cjs.map',
311+
'/path/to/.next/static/**/*.css.map',
311312
]);
312313
});
313314

@@ -331,6 +332,7 @@ describe('getBuildPluginOptions', () => {
331332
'/path/to/.next/static/**/*.js.map',
332333
'/path/to/.next/static/**/*.mjs.map',
333334
'/path/to/.next/static/**/*.cjs.map',
335+
'/path/to/.next/static/**/*.css.map',
334336
]);
335337
});
336338

@@ -355,6 +357,7 @@ describe('getBuildPluginOptions', () => {
355357
'/path/to/.next/static/**/*.js.map',
356358
'/path/to/.next/static/**/*.mjs.map',
357359
'/path/to/.next/static/**/*.cjs.map',
360+
'/path/to/.next/static/**/*.css.map',
358361
]);
359362
});
360363

@@ -788,6 +791,7 @@ describe('getBuildPluginOptions', () => {
788791
`${complexPath}/static/**/*.js.map`,
789792
`${complexPath}/static/**/*.mjs.map`,
790793
`${complexPath}/static/**/*.cjs.map`,
794+
`${complexPath}/static/**/*.css.map`,
791795
]);
792796
});
793797
});

0 commit comments

Comments
 (0)