Socket
Book a DemoInstallSign in
Socket

railspacker

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

railspacker

bundlerRubygems
Version
0.2.0
Version published
Maintainers
1
Created
Source

Railspacker

Railspacker is a alternative to Webpacker. The motivation is to give more control over the webpack to the developer, avoiding wrapping it in ruby, opting for the configuration.

Status

This is an early version, if you liked the design concept, and intend to use it, let me know. Consider contributing, knowledge with testing for rails plugins will be welcome.

Prerequisites

  • Ruby 5.1 (+ Yarn);
  • WebpackManifestPlugin on;

Getting started

Add this line to your application's Gemfile:

gem 'railspacker'

Then run bundle install

Next, you need to run the generator:

$ rails generate railspacker:install

Add script in application template via pack_path

<%= javascript_include_tag pack_path('pack_name.js') %>

Railspacker has created the necessary files and a preconfiguration for you to begin development. Read the next session to understand how to proceed.

Usage

Development

Start WebpackDevServer in separated process to serve live code reloading assets:

$ yarn run serve

NOTE: The devServer already comes preconfigured, if you want to change the configuration, be sure to look at the railspacker configuration in config/initializers/railspacker.rb

Test

System test approach is: compile packs before tests. For this, Railspacker installer added command Railspacker.run 'build-test' to your ApplicationSystemTestCase. So, when you run System Tests, yarn will run package script named 'build-test'. The output public/packs-test will be created, and ignored to git via .gitignore

Production

To production environment, Railspacker enhance the task rails assets:precompile. Thus, the packages will be compiled soon after the assets task:precompile.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 02 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.