feat(manifest): 构建后的结果改成js文件
This commit is contained in:
		
							parent
							
								
									9a7b9a28c3
								
							
						
					
					
						commit
						3443a50025
					
				@ -23,7 +23,7 @@ export default defineNuxtModule({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      const remoteEntry = `remoteEntry_${pkg.version}.js`;
 | 
					      const remoteEntry = `remoteEntry_${pkg.version}.js`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const outPath = path.join(process.cwd(), ".nuxt/generated/manifest.ts"); // 固定目录
 | 
					      const outPath = path.join(process.cwd(), ".nuxt/generated/manifest.js"); // 固定目录
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      fs.mkdirSync(path.dirname(outPath), { recursive: true });
 | 
					      fs.mkdirSync(path.dirname(outPath), { recursive: true });
 | 
				
			||||||
      fs.writeFileSync(
 | 
					      fs.writeFileSync(
 | 
				
			||||||
 | 
				
			|||||||
@ -82,7 +82,7 @@ export default defineNuxtConfig({
 | 
				
			|||||||
      let manifest;
 | 
					      let manifest;
 | 
				
			||||||
      try {
 | 
					      try {
 | 
				
			||||||
        // Nuxt buildDir 是 .nuxt
 | 
					        // Nuxt buildDir 是 .nuxt
 | 
				
			||||||
        const manifestPath = join(process.cwd(), ".nuxt/generated/manifest.ts");
 | 
					        const manifestPath = join(process.cwd(), ".nuxt/generated/manifest.js");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // 检查文件是否存在
 | 
					        // 检查文件是否存在
 | 
				
			||||||
        await fs.access(manifestPath);
 | 
					        await fs.access(manifestPath);
 | 
				
			||||||
 | 
				
			|||||||
@ -17,7 +17,7 @@ export default defineEventHandler(async (event) => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    // Nuxt buildDir 是 .nuxt
 | 
					    // Nuxt buildDir 是 .nuxt
 | 
				
			||||||
    const manifestPath = join(process.cwd(), ".nuxt/generated/manifest.ts");
 | 
					    const manifestPath = join(process.cwd(), ".nuxt/generated/manifest");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // 检查文件是否存在
 | 
					    // 检查文件是否存在
 | 
				
			||||||
    await fs.access(manifestPath);
 | 
					    await fs.access(manifestPath);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user