Comments (5)
There is a simple way to use vite is use vite api.
Just build a script that uses the vite plugin which add logic during writeBundle
to run the packaged product in qode.
I made a react-based template, vue and svelte also should be work : react-nodegui-vite-starter
from svelte-nodegui.
I have tried to simply bundle svelte-nodegui
App with Rollup and found it wouldn't be executed. There are several problems:
*.node
should be handled likenative-addon-loader
(maybe@rollup/plugin-url
is qualified enough)nodegui
itself has PostCSS and addon unknown QObject export bindings issues
So I just set @nodegui/nodegui
as externals, and it could be left in node_modules without being bundled which make the Application succeed to be executed. 🤣🤣🤣
Here is my example project, hope it could inspire you.
from svelte-nodegui.
Thank you!
Our webpack config is quite simple: https://github.com/nodegui/svelte-nodegui/blob/main/demo/webpack.config.js
I'm unfamiliar with Vite, but to port it to something like Rollup, I think the main thing that would be needed would be a Rollup equivalent of native-addon-loader
(which I'm unfamiliar with). Beyond that, you'd pretty much just take the Svelte starter template (which uses Rollup) and fill in the differences.
Vite is famous for using esbuild under-the-hood, but I'm not sure how that works for Node environments (it is typically used in browser environments).
Contributions welcome!
from svelte-nodegui.
Thanks @msyfls123! I will take a look!
@shirakaba As far as Vite goes, it's built on rollup and supports all rollup config options.
Sveltekit is built on Vite which is built on Rollup so it should be possible. Sveltekit builds for node by default with svelte-adapter-node. I believe it leverages ESBuild's native node bundling support.
As far as using .node
addons in Rollup, I'm wondering if rollup-plugin-natives
is what we would need?
from svelte-nodegui.
So I just set
@nodegui/nodegui
as externals, and it could be left innode_modules
without being bundled which make the Application succeed to be executed. 🤣🤣🤣
It's a valid workaround. I think I might have gave up and done the same with phin
as well (it's a really awkward library). It may have consequences for when you come to package the final app, however, so let's try to get past it!
Sveltekit is built on Vite which is built on Rollup so it should be possible. Sveltekit builds for node by default with svelte-adapter-node. I believe it leverages ESBuild's native node bundling support.
Oh nice, sounds promising :)
As far as using
.node
addons in Rollup, I'm wondering ifrollup-plugin-natives
is what we would need?
That certainly looks like it might do the trick!
from svelte-nodegui.
Related Issues (20)
- Issues with Webpack HOT 1
- native module error even if recompiled HOT 2
- how to open a new window? HOT 1
- Svelte NodeGUI starter template fails to complete npm install if path has certain punctuation in it (due to @nodegui/nodegui postinstall step failing)
- chrome://inspect not working as described in hello app
- Error while setting up Qode HOT 1
- Add jonasgrunert to contributors HOT 3
- Widget bindings should be generated - Lots of widgets are missing HOT 4
- Fish shell HOT 22
- Catch up with React NodeGUI (copy across the Table, TableItem, and ErrorPrompt components)
- Module not found: Error: Can't resolve '@nodegui/svelte-nodegui' HOT 4
- Rendering Breaks if User Components Used HOT 9
- webrtc HOT 1
- Gibberish main window HOT 7
- Layout failing with user components HOT 3
- Broken layout on Linux HOT 6
- Error on first run HOT 1
- License of Qt? HOT 1
- Is dead? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-nodegui.