Search code examples
ruby-on-rails-6webpacker

Rails 6 duplicating and application, impact of webpacker


A Rails 6 application in a directory that is named as the application would undergo a duplication of that directory & renaming the new one. This implies editing only the following files, as per conventional rails logic:

application.rb
cable.yml
database.yml
config/environments/production.rb
any reference to the versioning and deployment of the application

However, the name of the original application is invoked a couple of times in

Makefile
package.json

the latter is intended to be administrator-editable. The former not. It is a direct consequence of webpacker (notwithstanding a node_modules directory of ~ 72 MB ) being added to the workprocess of rails 6.0

What is the best way and steps to follow to duplicate the application and have two independent applications in their self-named directories?


Solution

  • Yes, the above steps do work in practice. Leaving it here as a memorandum.

    Editing only the following files, as per conventional rails logic:

    application.rb
    cable.yml
    database.yml
    config/environments/production.rb
    any reference to the versioning and deployment of the application
    package.json
    

    As to the

    Makefile
    

    I preferred emptying out the node_modules directory and

    yarn install --check-files
    

    to have that element up-to-date.

    Import a copy of database (or whatever the context implies) and rails s !