Comments (8)
Yes, use file
configuration option: https://github.com/railsware/js-routes#generator-options
from js-routes.
Thank you for pointing that out. I'm still having issues setting the output path, it seems that changes can only be made relative to app/javascript
. I believe this is the location where that limitation is set:
js-routes/lib/js_routes/configuration.rb
Line 77 in e158c58
All of the following configurations resulted in an error:
config.file = 'app/frontend/routes'
# app/javascript/app/frontend/routes isn't a file
config.file = Rails.root.join('app', 'frontend', 'routes')
# app/javascript/var/project/app/frontend/routes isn't a file
config.file = 'app/frontend/routes/routes.js'
# app/javascript/app/frontend/routes doesn't exist
config.file = Rails.root.join('app', 'frontend', 'routes', 'routes.js')
# app/javascript/var/project/app/frontend/routes doesn't exist
The closest I've gotten was using config.file = '../frontend/routes/routes.js'
, however this produced strange results. It generated the d.ts
file in the specified path, but the routes.js
file still generated in app/javascript
.
from js-routes.
In your last example: does app/frontend/routes
directory exist? Can you make it and see if it fixes the issue?
from js-routes.
Yes, the directory existed and routes.d.ts
generated there, but routes.js
was placed in app/javascript
, which also existed.
from js-routes.
I can confirm this (js-routes 2.2.1). Last version it worked is 2.0.8
from js-routes.
Fixed in 2.2.2 👍
from js-routes.
Fixed in 2.2.2 +1
Can confirm it's working.
I had just updated to 2.2.1 from 1.4.x and was trying to find the problem. Thank you very much @bogdan .
from js-routes.
This is still not working (app/assets/javascripts/) exists within my rails app:
config/initializers/js_routes.rb:
JsRoutes.setup do |c|
c.module_type = nil
c.namespace = 'Routes'
c.prefix = Figaro.env.url_prefix
c.file = 'app/assets/javascripts/routes.js'
end
rake js:routes
Errno::ENOENT: No such file or directory @ rb_sysopen - PATH/app/javascript/app/assets/javascripts/routes.js
from js-routes.
Related Issues (20)
- Typescript doesn't resolve properly the dynamic routes module HOT 5
- No default export in Typescript definitions file HOT 2
- Automatic updates via rack middleware HOT 5
- Prefer default_url_options over implictly filling with params when passing options hash HOT 2
- module_type: nil causes "NIL is not supported by runtime" HOT 4
- Thoughts for using with webpacker within a Rails engine HOT 2
- Task not found in Rails 7 app HOT 9
- Custom output path HOT 2
- module_type: nil causes "NIL is not supported by runtime" HOT 8
- NameError: uninitialized constant JsRoutes::JsRoute HOT 6
- function to get all paths to do custom filtering and selecting? HOT 3
- Error: Cannot read config file: while running yarn lint HOT 3
- Upgrade `rake assets:precompile` to `update js-routes` files in Rakefile did not work for me HOT 13
- ESM Tree shaking not working because __jsr.r() is potentially impure HOT 3
- Use configured Webpacker directory instead of default
- Options style route params HOT 8
- Emoji caused URIError: URI malformed HOT 1
- Rails engine support: Engine configurations impact the main app HOT 2
- Bug: Prefix is ignored if a namespace is used HOT 1
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 js-routes.