Comments (5)
Sure thing, thanks for working on this! I've gotten tired of all of webpack's complexity and am hoping this can be viable alternative to webpacker!
from vite_ruby.
Hi there! Thanks for providing the logs.
It's unlikely that npx vite
returns the same error as the other commands, as it doesn't run any Ruby code, where the CLI is defined.
Looking at the output of the info command, it would seem that vite-plugin-ruby
and vite
were not installed, likely due to a bug in the logic in this library's installation command which I'm planning to investigate tomorrow.
I have documented this common problem, and I'm planning to add a verification check to prevent silent failures when these packages are missing.
Please add vite-plugin-ruby
and vite
as development dependencies, install them (yarn, npm, pnpm, whatever you are using), and try again.
About the last comment, using the bin/vite
executable ensures any config overrides added in Ruby are passed to Vite, such as Rails environment, but in most setups running npx vite
is the same so feel free to add a script in your package.json if you prefer that, it will still read the config/vite.json
configuration.
from vite_ruby.
After a bit more looking at the source, it seems the root problem is that npx @antfu/ni -D #{ deps }
command is not actually adding the two deps as is being expected; hence my comments above them not showing up in my package.json
after vite install
. I'm not familiar with antfu/ni
and not really sure why the command wouldn't be working as expected and apparently failing silently.
Manually running yarn add -D vite@^2.0.3 vite-plugin-ruby@^1.0.13
clears up the issue and bin/vite dev
no longer exits immediately 🎊
To your comment about verification, I believe running npx vite
without vite being installed locally would still work, no? It seems like a safer verification might be just making sure vite
is listed as a dev dependency in package.json
.
from vite_ruby.
Agreed, for verification I'm thinking of checking both the plugin and vite are installed.
I'll leave this open as a reminder to fix the installation (it seems the command is succeeding so the yarn fallback is not used, but it's not actually installing the packages), and to add the verification before the dev and build commands.
Thanks for the report!
from vite_ruby.
It has been for me! Vite's defaults are great, and at the same time it's very easy to configure (TypeScript-enabled config file), and to extend with plugins.
Webpack is great too, but it requires a significant amount of configuration and specific knowledge about its internals.
Because of that, webpacker attempts to provide an "out of the box" experience, which then makes it really hard to eject from if you want to instead use something like vue-cli
.
That's why this library is intentionally narrow in scope: simplify Vite.js integration with Ruby, and get out of the way.
from vite_ruby.
Related Issues (20)
- yarn 3 Missing Executable
- How do I turn off the Inter-roman and Inter-italic fonts?
- Configurable option for location of vite.config.ts HOT 2
- Update rack-proxy to at least 0.7.5 HOT 2
- resolve_entries is slow when using vite_javascript_tag for very large and complex tsx react/relay files HOT 2
- `An import map is added after module script load was triggered` in console. HOT 4
- Fail to load styles from js files when it conflicts with stylesheet tag
- Support new default manifest location in Vite v5 HOT 9
- plugin_legacy is not working as expected
- Allow `.` as a valid option for `sourceCodeDir`
- 'conflicting chdir during another chdir block' calling vite_asset_path
- Can't find SVG file in manifest after upgrade to 3.5.0 HOT 2
- "The CJS build of Vite's Node API is deprecated." HOT 4
- Disabling cssCodeSplit breaks CSS file location used by tag helper in Rails HOT 1
- vite-rails live demo on Heroku is broken HOT 1
- clean command not detecting versions properly HOT 1
- Calling `bin/vite ssr` just exits with no errors
- vite_hanami in hanami 2.1
- vite.config.ts base: './' not applied
- How can I enable HMR to function with subdomains?
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 vite_ruby.