[Rails6] The development that is done while manually compiling js using webpack was very smooth and impressed.

How to proceed with development when compiling manually using webpack

When editing a component

% cd frontend #webpack.config.Directory where js is located
% webpack #webpack.config.Build js to load in app using js

The change of component is reflected by inputting the command. At this time, there is no problem even if you keep the rails server running in another tab. Therefore, when developing

Tab 1 Tab 2
The tab where the rails server is running webpack.config.Directory containing js
Edit component → build with webpack command

If you divide the tabs in the form of, development will be smooth.

Since the component is also compiled with webpack in advance, the rails application only needs to read one output js. Impression that the processing speed is quite different from reading the view with the view file under views of rails.

Recommended Posts

[Rails6] The development that is done while manually compiling js using webpack was very smooth and impressed.
Introducing the settings and reference articles that are first done in Rails new development
Succeeded in loading js manually compiled using webpack with rails6