Skip to content

Are there proposals for importmap-rails to work in rails 7 engines? #58

Open
@jamesw

Description

@jamesw

A new engine with Rails 7 alpha 2, generated usingrails plugin new custom_page --mountable --fullgenerates a new engine that includes the importmap-rails gem in the bundled gems but there is no ability to use it. Adding spec.add_dependency 'importmap-rails' to gemspec makes no difference. there is no importmap executable in the bin directory.
A call to bundle info importmap-rails
Produces

* importmap-rails (0.8.1)
	Summary: Use ESM with importmap to manage modern JavaScript in Rails without transpiling or bundling.
	Homepage: https://github.com/rails/importmap-rails
	Source Code: https://github.com/rails/importmap-rails
	Path: /home/jamie/.rvm/gems/ruby-3.0.0@custom_page/gems/importmap-rails-0.8.1

A call to rails --tasks lists
rails app:importmap:install # Setup Importmap for the app
I was expecting to see the same without app: prefix
A call to this task resolves to a template error
rails app:importmap:install

Don't know how to build task 'app:template' (See the list of available tasks with `rails --tasks`)
Did you mean?  app:tmp:create

Hope this is a clear enough question for you. If there is a workaround solution to this I'd be grateful to hear it and I'm sure others will too. The reason for me wanting this is that I totally failed to introduced webpacker in a rails 6.1.4 engine and I was hoping this was going to be my, much improved, solution
Cheers
James

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions