JuniorTour / resource-hint-generator

NPM package for generating prefetch, preload and other HTML resource hint
28 stars 2 forks source link

[Bug] 修改配置文件的 「resourcePath」为非 dist 目录,但是打包无法生成 resource-hint.js #1

Open baixiaobai-666 opened 9 months ago

baixiaobai-666 commented 9 months ago

[resource-hint-generator] distPath=./dist projectRootPathFromOption __dirname=/xxx/node_modules/resource-hint-generator/src distDirPath=/xxx/dist [resource-hint-generator] getFiles() ERROR:Error: ENOENT: no such file or directory, scandir '/xxx/dist' outputFilePath=/xxx/dist/resource-hint.js [generate-prefetch-script.js] writeToFile() ERROR:Error: ENOENT: no such file or directory, open '/xxx/dist/resource-hint.js' ✨ Done in 27.72s. image

JuniorTour commented 9 months ago

resourcePath改成distPath,应该就没问题了。

抱歉,这是我的失误,文章和项目没有同步更新,我改一下文章。

module.exports = {
  distPath: `./build`, // Correct
  // ...
}

image