eleventy-plus-vite
eleventy-plus-vite copied to clipboard
Install/Run Issues
Just an FYI, currently downloading the package as is and npm install/ npm start fails.
Sorry, I don't have the time to run through the errors atm, but I was hopeful for using this starter as it seemed promising :)
**ERROR** Failed to apply patch for package @11ty/eleventy-plugin-vite at path
node_modules/@11ty/eleventy-plugin-vite
This error was caused because @11ty/eleventy-plugin-vite has changed since you
made the patch file for it. This introduced conflicts with your patch,
just like a merge conflict in Git when separate incompatible changes are
made to the same piece of code.
Maybe this means your patch file is no longer necessary, in which case
hooray! Just delete it!
Otherwise, you need to generate a new patch file.
To generate a new one, just repeat the steps you made to generate the first
one.
i.e. manually make the appropriate file changes, then run
patch-package @11ty/eleventy-plugin-vite
Info:
Patch file: patches/@11ty+eleventy-plugin-vite+2.0.0-canary.1.patch
Patch was made for version: 2.0.0-canary.1
Installed version: 2.0.0-canary.2
and
**ERROR** Failed to apply patch for package rollup-plugin-critical at path
node_modules/rollup-plugin-critical
This error was caused because rollup-plugin-critical has changed since you
made the patch file for it. This introduced conflicts with your patch,
just like a merge conflict in Git when separate incompatible changes are
made to the same piece of code.
Maybe this means your patch file is no longer necessary, in which case
hooray! Just delete it!
Otherwise, you need to generate a new patch file.
To generate a new one, just repeat the steps you made to generate the first
one.
i.e. manually make the appropriate file changes, then run
patch-package rollup-plugin-critical
Info:
Patch file: patches/rollup-plugin-critical+1.0.8.patch
Patch was made for version: 1.0.8
Installed version: 1.0.9
Just looks like version bumps, but then I guess you need to check the updates themselves too.
Ignoring the above, I've managed to get it at least building... but there does seem to be a problem with vite serving assets. It will not process SCSS files. Changing them to CSS files seems to work. When building from a template change (i.e. base.njk), I get asset 404 errors on all assets which fail to load, site.webmanifest, js, css etc.
When adding eleventyConfig.setServerPassthroughCopyBehavior("copy");
in .eleventy.js, this seems to fix some problems.
I've also changed the postcss nesting package from "postcss-nesting" to "postcss-nested" ... and this seems to now work.
https://github.com/postcss/postcss-nested
@aaronstezycki Were you able to build? The dev server works with the changes you've mentioned above, but the build is generating binary CSS files. It looks like something is trying to convert them to font (WOFF) files instead of outputting text files.
edit: https://github.com/matthiasott/eleventy-plus-vite/issues/7#issuecomment-1229348220 This seems to have fixed it.
@aaronstezycki @mwaterous any chance you've tried using @11ty/eleventy-img
with this starter? I can't get the images to copy over when building.
@simplerethink I'm using @11ty/elenty-img
together with @11ty/eleventy-plugin-vite
here. I didn't branch off this starter, but basically you will have to output the images into _site
somewhere and make sure, the pathes are correct for vite to be picked up, I guess placing outside of _site
folder will not work, because that's outside of vites' scope. My setup does some renaming so the elventy-img
cache can find the files even after vite
has touched them. Therefore I put the images inside _site/assets
, same place vite
outputs per default.
@simplerethink I'm struggling with the same problem, I'm outputting images directly into _site/images/
folder, tried with _site/assets/images/
as @KiwiKilian suggested, with no changes in the output, that is, no images where copied over in the build process.
I'm scratching my head over this and I have not enough knowledge of Vite to mock around with the options.