Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit e4a414c

Browse files
committed
Update css.cache to true by default
1 parent ed8f492 commit e4a414c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

server/config.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function defaultConfig(): Readonly<RequiredConfig> {
2929
ssr: {},
3030
plugins: [],
3131
css: {
32-
cache: false,
32+
cache: true,
3333
modules: {},
3434
postcss: { plugins: ['autoprefixer'] },
3535
},
@@ -41,7 +41,7 @@ export function defaultConfig(): Readonly<RequiredConfig> {
4141
},
4242
react: {
4343
version: defaultReactVersion,
44-
esmShBuildVersion: 52,
44+
esmShBuildVersion: 53,
4545
}
4646
}
4747
}
@@ -74,7 +74,6 @@ export async function loadConfig(specifier: string): Promise<Config> {
7474
plugins,
7575
css,
7676
server,
77-
env,
7877
} = data
7978
if (isFramework(framework)) {
8079
config.framework = framework
@@ -112,13 +111,13 @@ export async function loadConfig(specifier: string): Promise<Config> {
112111
headers: util.isPlainObject(server.headers) ? toStringMap(server.headers) : {},
113112
rewrites: util.isPlainObject(server.rewrites) ? toStringMap(server.rewrites) : {},
114113
middlewares: Array.isArray(server.middlewares) ? server.middlewares.filter(v => typeof v === 'function') : [],
115-
compress: typeof server.compress === 'boolean' ? server.compress : true
114+
compress: typeof server.compress === 'undefined' ? true : Boolean(server.compress)
116115
}
117116
}
118117
if (util.isPlainObject(css)) {
119118
const { cache, modules, postcss } = css
120119
config.css = {
121-
cache: Boolean(cache),
120+
cache: typeof cache === 'undefined' ? true : Boolean(cache),
122121
modules: util.isPlainObject(modules) ? modules : {},
123122
postcss: isPostcssConfig(postcss) ? postcss : { plugins: ['autoprefixer'] }
124123
}
@@ -238,7 +237,7 @@ function toStringMap(v: any): Record<string, string> {
238237
const imports: Record<string, string> = {}
239238
if (util.isPlainObject(v)) {
240239
Object.entries(v).forEach(([key, value]) => {
241-
if (key == '') {
240+
if (key === '') {
242241
return
243242
}
244243
if (util.isFilledString(value)) {

0 commit comments

Comments
 (0)