from pathlib import Path root=Path(r'G:\项目\NumberSwipe-Variants');dest=root/'campaign-50' s=(root/'tools/design-pages.mjs').read_text(encoding='utf-8-sig') s=s.replace("import {definitions} from './definitions.mjs';", "") s=s.replace("from './engine-template.mjs'", "from '../rules.mjs'") s=s.replace("const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'..');", "const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'..');const definitions=[{id:'campaign-50',title:'50关DEMO',rule:'每格一次;数字为访问步号,各关显示当前启用规则。'}];") s=s.replace("const folder=path.join(root,'modes',def.id)", "const folder=root") s=s.replace('for(let i=0;i<8;i++)','for(let i=0;i