Encountering an issue while attempting to build:
Building for production...Error: ENOENT: no such file or directory, stat '/Users/me/Code/project/index.html'
Software Package: "prerender-spa-plugin": "^3.1.0"
Location: vue.config.js
:
const PrerenderSPAPlugin = require('prerender-spa-plugin');
const Renderer = PrerenderSPAPlugin.PuppeteerRenderer;
const path = require('path');
module.exports = {
configureWebpack: config => {
if (process.env.NODE_ENV !== 'production') return;
return {
plugins: [
new PrerenderSPAPlugin({
staticDir: path.join(__dirname),
routes: ['/'],
minify: {
collapseBooleanAttributes: true,
collapseWhitespace: true,
decodeEntities: true,
keepClosingSlash: true,
sortAttributes: true,
},
renderer: new Renderer({
renderAfterDocumentEvent: 'render-event',
}),
}),
],
};
},
};
No other paths are defined, just a single index.html page.
Additionally, after running yarn build
and encountering the error, attempts to terminate the process in terminal prove futile as it continuously displays Building for production...
with no progress unless terminal is forcibly closed.
Edit: Trying to include
staticDir: path.join(__dirname, './public')
results in the build hanging indefinitely without any reported errors.