Skip to content

Commit

Permalink
fix: overrides might be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Oct 19, 2023
1 parent 828f9da commit 3e0c0c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/preset-umi/src/features/overrides/overrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default (api: IApi) => {
content = await transform(content, filePath);
api.writeTmpFile({
path: 'core/overrides.css',
content,
content: content || '/* empty */',
noPluginDir: true,
});
cachedContent = content;
Expand Down
4 changes: 3 additions & 1 deletion packages/preset-umi/src/features/overrides/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export async function transform(cssContent: string, filePath: string) {
const result = await require('postcss')([
selectorPlugin,
importPlugin,
]).process(cssContent, {});
]).process(cssContent, {
from: 'overrides.css',
});
return result.css;
}

0 comments on commit 3e0c0c7

Please sign in to comment.