Skip to content

Commit 97d80eb

Browse files
committed
fix: stabilize mpx watch hmr on windows
1 parent c76b164 commit 97d80eb

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

packages/weapp-tailwindcss/test/watch-hmr-regression.unit.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,12 @@ describe('watch-hmr regression cases', () => {
952952
path.resolve('/repo', 'demo/mpx-tailwindcss-v4/dist/wx/custom-tab-bar/index.wxml'),
953953
)
954954
expect(mpxV4Case?.devScript).toBe('dev:e2e-watch')
955+
expect(mpxV4Case?.env).toMatchObject({
956+
CHOKIDAR_INTERVAL: '100',
957+
CHOKIDAR_USEPOLLING: '1',
958+
WATCHPACK_POLLING: 'true',
959+
})
960+
expect(mpxV4Case?.initialMutationDelayMs).toBe(15_000)
955961
expect(mpxV4Case?.styleMutation.sourceFile).toBe(
956962
path.resolve('/repo', 'demo/mpx-tailwindcss-v4/src/pages/component/index.mpx'),
957963
)

tools/weapp-tailwindcss-scripts/src/watch-hmr-regression/cases/demo/extended.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ const taroWatchEnv = {
2525
WATCHPACK_POLLING: 'true',
2626
}
2727

28+
const mpxWatchEnv = {
29+
CHOKIDAR_USEPOLLING: '1',
30+
CHOKIDAR_INTERVAL: '100',
31+
WATCHPACK_POLLING: 'true',
32+
}
33+
2834
const taroViteWatchEnv = {
2935
...taroWatchEnv,
3036
NODE_ENV: 'production',
@@ -264,9 +270,10 @@ export function buildDemoExtendedCases(baseCwd: string): WatchCase[] {
264270
label: 'demo/mpx-tailwindcss-v4',
265271
project: 'demo/mpx-tailwindcss-v4',
266272
group: 'demo',
267-
initialMutationDelayMs: 5_000,
273+
initialMutationDelayMs: 15_000,
268274
cwd: path.resolve(baseCwd, 'demo/mpx-tailwindcss-v4'),
269275
devScript: 'dev:e2e-watch',
276+
env: mpxWatchEnv,
270277
outputWxml: path.resolve(baseCwd, 'demo/mpx-tailwindcss-v4/dist/wx/custom-tab-bar/index.wxml'),
271278
outputJs: path.resolve(baseCwd, 'demo/mpx-tailwindcss-v4/dist/wx/custom-tab-bar/index.js'),
272279
outputStyleCandidates: [

0 commit comments

Comments
 (0)