kjirou / minimum_javascript_on_rails

A Rails application that is set a minimal Node.js-based JavaScript build environment without webpacker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

minimum_javascript_on_rails

💁‍♀️ What application is this?

This is a sample of a Ruby on Rails application that is set a minimal Node.js-based JavaScript build environment without webpacker.

If your Rails application meets some of the following conditions, using this repository configuration may be more maintainable.

  • Does not contain much JavaScript code.
  • sprockets-rails is enough for the style-sheet build environment.
  • Does not install unused npm packages.
  • Manages npm packages as individually as possible so that the required packages can be updated immediately.
  • Developers want to learn more basic JavaScript knowledge than webpacker.

🔧 Installation

Softwares that needs to be locally installed

Install this sample application

git clone git@github.com:kjirou/minimum_javascript_on_rails.git
bin/setup

🐱 Functions added to the client side

  • npm run build
    • This command is for a stand-alone build. Mainly we use it for production release.
  • npm run watch
    • If the npm run watch is running with the rails server, JavaScript source changes are applied when you reload the browser.
  • npm run clean
    • Clean up files generated from npm run build or npm run watch.

⚙️ Customize settings

Run unit tests with Jest on Node.js

Change the Babel to the TypeScript

Create a client side development environment

  • (Write later?)

Build CSS with Node.js

  • (Write later?)
  • (Write later?)

Prevent the "Please execute npm run build command before operating the Rails." error

Reduce the file size of the built JavaScript

  • I'm sorry, I don't know well.
  • You should probably search for "webpack chunk" first.

About

A Rails application that is set a minimal Node.js-based JavaScript build environment without webpacker


Languages

Language:Ruby 74.3%Language:HTML 13.0%Language:JavaScript 11.1%Language:CSS 1.6%