-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vite chokes generated *.bib files in production build? #26
Comments
I believe this is a vite thing. Can you generate them inside of |
Sorry, I do not know how to to that... How should/would I reference this vite public dir? Currently I build these files via ---
pagination:
data: bibtex
size: 1
alias: bibtex
permalink: "publications/bibtex/{{ bibtex.bibtexLabel }}.bib"
layout: "layouts/bibtex.njk"
---
{{ bibtex.bibtexItem | safe }} I've found a promising vite config option: https://vitejs.dev/config/shared-options.html#assetsinclude eleventyConfig.addPlugin(EleventyVitePlugin, {
viteOptions: {
assetsInclude: ['**/*.bib'],
}
}); ...but this did not resolve my issue.... |
Perhaps related: ├── assets
│ ├── app.js
│ └── app.scss
├── downloads
│ └── myfile.pdf
├── eleventy.config.js
└── src
├── _includes
│ └── layout.njk
└── index.md // eleventy.config.js
const EleventyVitePlugin = require('@11ty/eleventy-plugin-vite')
module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(EleventyVitePlugin);
eleventyConfig.addPassthroughCopy('assets');
eleventyConfig.addPassthroughCopy('downloads');
return {
dir: {
input: "src",
output: "_site"
},
}
} ❌ Build via
✅ ...but expected (and strangely I get the desired result with the # _site generated via `npx eleventy --serve`
_site/
├── assets
│ ├── app.js
│ ├── app.scss
│ ├── index.74d94aed.css
│ └── index.b2fff5ad.js
├── downloads
│ └── myfile.pdf
└── index.html Am I doing something completely wrong? Thanks in advance for any hints. I've put together a minimal eleventy project for this setup: https://github.com/tombreit/eleventy-vite-minimal/tree/vite-and-pdfs |
@tombreit So if you have a
and running
@zachleat Do mean generate them from So for instance I have a
that files is generated at I seem to be missing something here …? |
I had a similar problem with PDF files. I've managed to get it to work by having this folder structure
and then passthrough-copying public: eleventyConfig.addPassthroughCopy("public"); This then gives the output of:
The passthrough copying is necessary, it doesn't work if you just put public inside src. For things such as sitemaps and feeds, I was able to get them to work by leaving them in src with a permalink like |
Hi,
I'm generating some
*.bib
-files from global datajs
viapagination
. When building vianpx eleventy --serve
everything works as expected: These*.bib
-files end up in the output directory (here:_site/publications/bibtex/*bib
).These
bib
-files are plaintext files with bibliographic data and are not meant to be further processed by vite:But in a production build via
npx eleventy
, it seems these*.bib
-files get rendered by eleventy, but somehow got choked/missed/deleted by vite afterwards...:via
npx eleventy --serve
via
npx eleventy
If I disable eleventy-plugin-vite or generate these files as
*.html
(instead of*.bib
) everything works as expected.What am I doing wrong or how do I keep my generated
.bib
files in a production build?Versions
The text was updated successfully, but these errors were encountered: