-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[QUESTION] Integration with Vite #2
Comments
I have now tested my approach, and the two step build works as expected. I am just not sure if the dev server will work in the same way. |
I think I have finally figured this out.
export default {
input: 'src/index.pres',
include: [
'src/components/**/*.html'
],
output: {
file: 'src/index.html',
formatting: 'none'
}
}
"watch": "nodemon --watch ./src -e pres --exec \"npx presto && vite\"",
"serve": "vite preview",
"build:markup": "presto --config presto.config.js",
"build:bundle": "vite build",
"build": "npm-run-all build:markup build:bundle"
What do you think about this? |
What would be ideal, is to have a rollup/vite plugin. Then presto could become part of the normal build/serve chain. |
I've had a chance to clone and test your scaffolding and think this is a good approach given the current options made available by Presto. Mentioned in the documentation, I'd like to get chokidar bundled-in with Presto so that developers will have more options available to them like an As far as order of execution goes, I think you've hit it exactly. The only additional consideration I might add would be in adopting A plugin would be a terrific approach to handling this. Additional issues have been brought to my attention which are pushing me further and further away from cheerio as the DOM processor in Presto. Once I've landed on a nice replacement, I intend to swap it into the current codebase, clean-up the structure, and then stage for an open release. In this way, it'll be nice to get some additional eyes on where plugins can hook into Presto — generating what I think will be really valuable insight, especially for frameworks/utilities like Vite. Keep up the solid work! I'm looking forward to trying-out W.A.S.P this coming week! |
Hi @stephancasas. So, my boilerplate with the component based structure is coming on nicely. I have, however, decided to swap out rollup with Vite, for build and bundling. Everything works really well. I just want some advice on one item, when including presto in my build chain.
Vite relies on the
index.html
file as its starting point. So, before adding presto to my app, the build would basically do the following:index.html
from thesrc
folderindex.js
in thesrc
folder, which is embed in theindex.html
file, and does all the js imports, bundling, etc, etcindex.html
) to thelist
folderAll of this works 100%.
Now, when including presto in my project, I will have a situation whereby both presto and vite need to make changes to the
index.html
. The only way I can see around this is:src
(exampleapp.html
)presto.config.js
to look something like this:index.html
that vite will use to build and bundleDoes this make sense? Can you think of an easier/better way to achieve this?
The text was updated successfully, but these errors were encountered: