Skip to content

Commit 7719ef5

Browse files
Adamlyu-hubSingle-Dancer
authored andcommitted
feat: h5中编译器为vite时支持配置vite下所有server options
1 parent bb41575 commit 7719ef5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/taro-vite-runner/src/h5/config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,19 @@ export default function (viteCompilerContext: ViteH5CompilerContext): PluginOpti
176176
proxy: (serverOption.proxy as any) || {},
177177
headers,
178178
hmr,
179+
watch: serverOption.watch ?? {},
180+
fs: {
181+
strict: serverOption.strict ?? true,
182+
allow: serverOption.allow ?? [],
183+
deny: serverOption.deny ?? ['.env', '.env.*', '*.{crt,pem}', '**/.git/**'],
184+
},
185+
allowedHosts: serverOption.allowedHosts || [],
186+
middlewareMode: serverOption.middlewareMode ?? false,
187+
strictPort: serverOption.strictPort ?? false,
188+
sourcemapIgnoreList: serverOption.sourcemapIgnoreList ?? ((sourcePath) => sourcePath.includes('node_modules')),
189+
origin: serverOption.origin,
190+
cors: serverOption.cors ?? true,
191+
warmup: serverOption.warmup ?? {},
179192
},
180193
css: {
181194
postcss: {

0 commit comments

Comments
 (0)