Skip to content
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

Entry points and destination values defined in config/initializers/parcel.rb are not being used #9

Open
mickmister opened this issue Jun 30, 2018 · 1 comment

Comments

@mickmister
Copy link

mickmister commented Jun 30, 2018

I am attempting to change the location of the application's entry point, as well as the destination. Following the guide in the README, I have changed the values in config/initializers/parcel.rb to be the following:

Rails.application.config.parcel do |parcel|
  parcel.entry_points = %w(app/assets/javascripts/application.js)
  parcel.destination = 'public/assets'
end

I then receive the following output from the console, from running bundle exec rake assets:precompile

<root>/node_modules/.bin/parcel build app/javascript/application.js -d public/parcels
 Cannot find module '<root>/app/javascript/application.js'  at Resolver.resolve (<root>/node_modules/parcel-bundler/src/Resolver.js:70:17)

I am able to fix this by editing <gem_dir>/parcel-rails-0.9.3/lib/parcel-rails.rb
and changing the block

config.parcel.entry_points = %w[app/javascript/application.js]
config.parcel.destination = 'public/parcels'

to

config.parcel.entry_points = %w(app/assets/javascripts/application.js)
config.parcel.destination = 'public/assets'

Obviously this is a hacky fix. I want to know if this is something I can help look into. I've browsed the repo and I haven't figured out where the initializer is supposed to override the value set in the lib/parcel-rails.rb file that is within the library.

@hellojere
Copy link
Contributor

Agree, this seems to have no effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants