How to completely remove webpack and all its dependencies from Rails App
- remove
bin/webpack
or runbundle exec rake rails:update:bin
- remove
config/webpacker.yml
- remove
config/webpack
- remove
app/javascripts
- remove
config.webpacker.check_yarn_integrity = false
fromconfig/{development, test, production}.rb
- verify that you don't have webpacker in your gemfile and run
bundle install
orbundle clean
imho, don't create your rails app with generators (unless it's your own)
Rails - How to remove vue.js with webpack
webpacker
v5 currently doesn't have uninstall support, so you'd have to manually undo the install:vue
command's actions:
Remove vue loader from config/webpack/loaders: Delete
<rootDir>/config/webpack/loaders/vue.js
Remove vue loader: In
<rootDir>/config/webpack/environment.js
:a. delete
const { VueLoaderPlugin } = require('vue-loader')
b. delete
environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin())
c. delete
const vue = require('./loaders/vue')
d. delete
environment.loaders.prepend('vue', vue)
Remove
.vue
file extension support from Webpack config: In the Webpacker config file, delete- .vue
Remove example entry file: Delete
<srcDir>/hello_vue.js
Remove Vue app file: Delete
<srcDir>/app.vue
Uninstall Vue dependencies: From
<rootDir>
, runyarn remove vue vue-loader vue-template-compiler
How to remove Yarn from a Rails app completely?
When you create a rails project, you can add --skip-yarn
as rails new app_path --skip-yarn
.
Is it possible/advisable to run Rails 6 without webpack(er)?
Yes, you can drop gems from Gemfile, delete the created node_modules folder and package.json file.
After that run bundle to clean up the Gemfile.lock and start code the old way with normal views and templates. Mention, that you will have to add js engine like Google V8.
In fact webpacker and node are not required to run a rails 6 application.
Unable to build and deploy Rails 6.0.4.1 app on heroku - Throws gyp verb cli error
I had a similar problem but resolved by following steps.
- Run the following command.
heroku buildpacks:add heroku/nodejs --index 1
- Update node version from
16.x
to12.16.2
in package.json.
Related Topics
Require File Without Executing Code
How to Refresh a Page with Turbolinks
Emacs Ruby Method Parameter Indentation
How to Calculate Next, Previous Business Day in Rails
How to Find .Index of a Multidimensional Array
Ruby Group Hashes by Value of Key
How to Specify a Minimum Ruby Version in a Gemspec
Different Background Color for Different Pages in Rails
Ruby on Rails Active Record Return Value When Create Fails
Solving Dependency Constraints
Phonegap and Rails 3: How to Interact with a Rails 3 App
How to Log Specific Request Details to Rails Server Logs
How to Merge Two Hashes That Have Same Keys in Ruby
Use Same Controller for Multiple Routes